[ create a new paste ] login | about

Link: http://codepad.org/jsKrX9BY    [ raw code | output | fork ]

C, pasted on Jan 21:
#include <stdio.h>
int main() {
 int a[] = { 123, 456, 789, 999 };
 int i, x, y, z;

  i = 0;
  x = a[i];
  y = a[i];
  z = a[i];
  printf("i=%d, x=%d, y=%d, z=%d\n", i, x, y, z);

  i = 0;
  x = a[i++];
  y = a[i++];
  z = a[i++];
  printf("i=%d, x=%d, y=%d, z=%d\n", i, x, y, z);

  i = 0;
  x = a[++i];
  y = a[++i];
  z = a[++i];
  printf("i=%d, x=%d, y=%d, z=%d\n", i, x, y, z);

  return 0;
}


Output:
1
2
3
i=0, x=123, y=123, z=123
i=3, x=123, y=456, z=789
i=3, x=456, y=789, z=999


Create a new paste based on this one


Comments: