Answer the question
In order to leave comments, you need to log in
Why is there an invalid conversion from 'char' to 'char*' error?
Here is the code:
char *val[] = {"xxxxxxy", "yxxyyyy", "xxyxxyx", "xxxxyyx", "yxxyyxx", "xyxxyxx", "xyxxxxx", "xxxyyyy", "xxxxxxx", "xxxxyxx"};
char *a = val[0];
char *b = a[0];
Answer the question
In order to leave comments, you need to log in
val - array of strings = array of arrays of characters
a - string = array of characters
b - character
char b = a[0];
That's right - the array a is single characters, not pointers to characters.
char *val[] - array of pointers to a character - char*
char* - array of characters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question