So I''ll simply begin with this concept:
It''s not my mistake, it''s my compiler which doesn''t accept it...
and such a perfectionist snob he is...
So I would like some people to help me with overcoming my problem,
not talking about my temporary insanity, talking about why my compiler doesn''t like me having a pointer to a 2D array.
Ok, now seriously, don''t want to waste your time. [Too late though].
char * *p = new char[20][30];
I realize the ''p'' should be declared differently than as I have declared above, but how?
I didn''t really get the concept of pointers to 2 dimensional arrays.
Any help would be appreciated.
A compiler gone bad....
Actually it is your mistake.
Your compiler expected something like this
But you gave him something else. Declaring a 2d array like you did is ok for static arrays, but doesn''t work for dynamic arrays.
If you look at the code I gave, the first new creates an array of char pointers, then for each pointer it creates an array of chars.
Your compiler expected something like this
|
But you gave him something else. Declaring a 2d array like you did is ok for static arrays, but doesn''t work for dynamic arrays.
If you look at the code I gave, the first new creates an array of char pointers, then for each pointer it creates an array of chars.
April 26, 2001 03:47 PM
Thanks a lot.
I still think my compiler should do what I mean and not what I type but that''s the problem with compilers today
I still think my compiler should do what I mean and not what I type but that''s the problem with compilers today
![](smile.gif)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement