Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

An enigma

Name: Anonymous 2009-06-09 18:35

So, /prog/, a C question: I have int somevariable [10][10]; How do I declare a pointer to the first row of this array?

Name: Anonymous 2009-06-10 16:38

>>15
Syntactic sugar implies indifference to semantics. Try this,


int (*row)[10];
int somevariable[10][10];

printf("%u != %u\n", sizeof row, sizeof somevariable);


As you see, semantically, the two expressions, `sizeof row' and `sizeof somevariable' are different. That means arrays are not syntactic sugar for pointers.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List