Skip to content

Instantly share code, notes, and snippets.

@bongtrop
Last active December 19, 2015 11:29
Show Gist options
  • Save bongtrop/5947724 to your computer and use it in GitHub Desktop.
Save bongtrop/5947724 to your computer and use it in GitHub Desktop.
Test in numer
#include <stdio.h>
int main() {
int a=0,i=2;
int test[4][2];
a+=i;
test[0][0]=a;
test[0][1]=i;
a=0;i=2;
a=+i;
test[1][0]=a;
test[1][1]=i;
a=0;i=2;
a=++i;
test[2][0]=a;
test[2][1]=i;
a=0;i=2;
a=i++;
test[3][0]=a;
test[3][1]=i;
printf ("[a+=i] = a(%d), i(%d)\n[a=+i] = a(%d), i(%d)\n[a=++i] = a(%d), i(%d)\n[a=i++] = a(%d), i(%d)\n",test[0][0],test[0][1],test[1][0],test[1][1],test[2][0],test[2][1],test[3][0],test[3][1]);
return 0;
}
/*
Result :
[a+=i] = a(2), i(2)
[a=+i] = a(2), i(2)
[a=++i] = a(3), i(3)
[a=i++] = a(2), i(3)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment