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:00

He asks a pointer to the first row. That means something which points to a row. Expressions of type int * point to an integer int. What OP literally asks for is this:


int (*rows)[10] = somevariable;


Of course it wouldn't behave, in most cases, any differently than `somevariable', in fact, `somevariable' becomes a pointer of such type in most expressions.

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