View Single Post
Old Sep 8th, 2006, 7:33 PM   #4
Adak
Hobby Coder
 
Join Date: May 2006
Posts: 57
Rep Power: 0 Adak is an unknown quantity at this point
Quote:
Originally Posted by JawaKing00
Ok, Pointers confuse the heck out of me, and pointers to arrays only make things worse.

Right now, I've got a number of two dimensional arrays of structures where one of the elements of the structure is a string array. On startup, depending on the configuration of the system, only one of the arrays will be used. I need to handle this by using a pointer to point to that array.

Basically I have no clue how to set up that pointer to correctly point to that array. Here is an example of my situation:

Any help would be hugely appreciated. Like I said, Pointers confuse me to no end.
Internally, C handles array as with pointers. But that's internally - YOU can just use the array's name and element number, and off you go.

Pointers are wonderful, and very powerful, but if they're leading you into great confusion, just use them very sparingly. When you're working with a 2d array, pointer notation in your code does NOT help it's clarity, one bit. Array[2]2], is infinitely clearer than any other notation, including pointer.

Adak
Adak is offline   Reply With Quote