|
-
October 23rd, 2007, 11:14 AM
#7
Re: 2d array pointer
 Originally Posted by Hermit
What are you trying to do by assigning it to 0?
An array is not just a pointer, it occupies a space on the stack. So it cannot (or should not) be NULLed, if that's what you're trying to do. If you're trying to initialize all elements of the array to 0, how is the compiler supposed to know how many elements there are if you don't explicitly supply a second dimension?
engage your brain please.
I can set a pointer to NULL if I want to - I'm not accessing it yet.
I have explicitly supplied a second dimension :
double q[][8] = 0; /// not ok. THE 8 IS THE SECOND DIMENSION.
sensible responses only
Last edited by c94wjpn; October 23rd, 2007 at 11:16 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|