Quote:
|
Originally Posted by Marvel_us
What if he just did the same thing without the pointers....ie:
char myArray[10];
char str = "string!";
myArray[3] = str;
Wouldn't he get the same results or no?
|
first off, what you wrote is a syntax error
second, if he wrote
char myArray[10][X]; //where X is the max size of the string
char str[X] = "string!"; //haven't worked with strings in a while might have to call a function to convert the string to the char array. don't remember. (#include string.h)
then
myArray[3] = str;
then myArray[3] would contain the value of str, ie: "string!" and not a pointer to the pointer of the string.