|
-
October 12th, 1999, 09:24 AM
#1
multiple-index character arrays
HELP, Please!!!
How do I declare, dynamically create and use a double-subscript array of character pointers??? EX: If it is done statically, I would do this:
char *myarry[num_rows][num_columns];
I don't know how many rows there will be so I want to do it dynamically. The number of columns is fixed at three. The problem is, I'm stupid when it comes to pointers to pointers and dynamic allocation. Can someone show me the light? I thought it should look something like this:
char *buffer = "sentence";
char **words;
words = new char*[rows][3];
words[row][col] = buffer;
but the Microsoft Visual C++ 6.0 compiler won't accept it because the types don't match. What am I doing wrong?
Thanks!
[email protected]
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
|