fork(2) download
  1. //given 2 distinct types
  2. struct Foo{ int a,b,c; };
  3. struct Bar{ float x,y,z; };
  4.  
  5. //and a function that takes each type by pointer
  6. void function(struct Foo* x, struct Bar* y){}
  7.  
  8. int main() {
  9. struct Foo x;
  10. struct Bar y;
  11.  
  12. //why am I able to pass both parameters in the wrong order,
  13. //and still get a successful compile without any warning messages.
  14. function(&y,&x);
  15.  
  16. //compiles without warnings.
  17. //potentially segfaults based on the implementation of the function
  18. }
Success #stdin #stdout 0s 2152KB
stdin
Standard input is empty
stdout
Standard output is empty