Jack Palevich | 43aaee3 | 2009-07-31 14:01:37 -0700 | [diff] [blame] | 1 | int testReturn() { |
| 2 | return 10, 20, 30; |
| 3 | } |
| 4 | |
| 5 | int testArg(int a) { |
| 6 | return a; |
| 7 | } |
| 8 | |
| 9 | void testComma() { |
| 10 | int a; |
| 11 | 0, a = 10,20; |
| 12 | printf("statement: %d\n", a); |
| 13 | a = 1; |
| 14 | if (a = 0, 1) { |
| 15 | printf("if: a = %d\n", a); |
| 16 | } |
| 17 | int b = 0; |
| 18 | a = 10; |
| 19 | while(b++,a--) {} |
| 20 | printf("while: b = %d\n", b); |
| 21 | b = 0; |
| 22 | for(b++,a = 0;b++, a < 10; b++, a++) {} |
| 23 | printf("for: b = %d\n", b); |
| 24 | b = testReturn(); |
| 25 | printf("return: %d\n", b); |
| 26 | b = testArg((a,12)); |
| 27 | printf("arg: %d\n", b); |
| 28 | } |
| 29 | |
| 30 | |
| 31 | |
| 32 | int main() { |
| 33 | testComma(); |
| 34 | return 0; |
| 35 | } |