Topic: HELP: Question about using new with arrays


Author: android@netcom.com (Pramod Kalapa)
Date: Thu, 22 Dec 1994 20:07:54 GMT
Raw View
I have a question about using "new" to allocate a multidimensional
array in C++.
The statement

char *ptr = new char[10][20];

generates a compiler error ""char(*)[20]" cannot be converted to char*" (on
the IBM xlC compiler).
How can I dynamically allocate the array without resorting to casting ?
Please email any responses
Thanks