[ create a new paste ] login | about

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

C, pasted on Jul 8:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>

int main(void)
{
 int x[5] = {30, 25, 33, 15, 22};
 int *p;
 int i;
 p = x;
 printf("*P  = %d\n", *p);
 for(i = 0; i < 5; i++)
 {
  printf("*(p+%d) = %d\n", i, *(p + i));
 }
 return 0;
}


Output:
1
2
3
4
5
6
*P  = 30
*(p+0) = 30
*(p+1) = 25
*(p+2) = 33
*(p+3) = 15
*(p+4) = 22


Create a new paste based on this one


Comments: