Rcently,i come across a problem,i wrote a code as following:
but when i copy it into codeblocks and wDEV c++,then i rebuild it ,it could not success,but when i rebuild it in c-free,it works!~~nothing wrong.Code:#include <stdio.h> //#include <stdlib.h> void ex(int &a,int &b) { int t; t = a; a = b; b = t; } int main() { int a,b; a = 1; b = 2; printf("%d%d\n",a,b); ex(a,b); printf("%d%d\n",a,b); //printf("Hello world!\n"); return 0; }
could someone tell me why?
Thank you !