I assume that char *myArray[1] = "Hello!" ; char **ptr; *ptr = &myArray[0] is not compatible because one is an array and the other an integeral type?
I assume that char *myArray[1] = "Hello!" ; char **ptr; *ptr = &myArray[0] is not compatible because one is an array and the other an integeral type?
Wrong.
What type is *ptr?
What type is &myArray[0]?
I think you meant *ptr = myArray[0]; but that's uninitialised memory according to your example, you want *ptr = myArray[1];
char *myArray[] is an array of pointers to characters, so each index is a pointer to a character(s).
Note, myArray ( and hence &myArray[0] ) is wrong because that's an array of pointers to character(s) and hence the name points to the address of a pointer and not the first character.
Last edited by CSaw; 07-18-2010 at 04:24 PM.