B
bintom
We can dynamically allocate memory using the 'new' operator.
char *cptr = new char[21];
Now, I'm trying to dynamically allocate 3 strings with the following
code on Dev C++. However, an error message 'Invalid initializer' is
generated. Can anyone tell me how to do it correctly?
char *cptr[3] = new char[3][21];
Thanks,
Bintom
char *cptr = new char[21];
Now, I'm trying to dynamically allocate 3 strings with the following
code on Dev C++. However, an error message 'Invalid initializer' is
generated. Can anyone tell me how to do it correctly?
char *cptr[3] = new char[3][21];
Thanks,
Bintom