[ create a new paste ] login | about

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

mohit_at_codepad - C, pasted on Mar 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>

#define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0]))
int array[] = {23, 34, 12, 17, 204, 99, 16};

int main()
{
  int d;
  //for(d=-1;d <= (int)(TOTAL_ELEMENTS-2); d++) // signed unsigned
  for(d=-1;d <= (TOTAL_ELEMENTS-2); d++)
    printf("%d\n",array[d+1]);
  return 0;
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: