dimanche 21 août 2016

Why does the following three printf statements print the same value? [duplicate]

This question already has an answer here:

int data[2][2] = {1,2,3,4};
int (*p)[2];
p = &data[0];
printf("%dn",p);
printf("%dn",data[0]);
printf("%dn",&data[0]);

In this program the value of data[0] and &data[0] returns the same answer. Can anyone provide the explanation?

Aucun commentaire:

Enregistrer un commentaire