[ create a new paste ] login | about

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

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

int main() {

    char td[6][4] = { {0,1,2,3}, {4,5,6,7}, {8,9,10,11}, 
                      {12,13,14,15}, {16,17,18,19}, {20,21,22,23}  };
    char* p = *td;  

    printf("Address of td: \t%p, value=%u\n", td, (int)**td);
    printf("Address of p: \t%p, value=%u\n", p, (int)*p);
    p = p + 4;   /* How do I skip to the start of {4,5,6,7} (ie to be pointing at 4) ?  */ 
    printf("Address of p: \t%p, value=%u\n", p, (int)*p);

    return 0;
}


Output:
1
2
3
Address of td: 	0xbfb875dc, value=0
Address of p: 	0xbfb875dc, value=0
Address of p: 	0xbfb875e0, value=4


Create a new paste based on this one


Comments: