str[2][0] == white string first char
str[0][4] == red string past end(highest is [2]
str[1][0] == yellow string first char
str[2][3] == white string fourth char
str[0][3] == red string past end(highest is [2]
str[1][4] == yellow string 5th char
That's actually helpful. I guess the code is not the problem. Hmm. I plan to use MVS for C# i guess i will add the C++ option on it as well. CodeBlocks is not kind to me all the time.
1. const needed (the type of a narrow string literal is array of const char)
2. In the braced-init-list omit braces around the initialiser for a scalar.
To force the GNU compiler to conform to standard C++ (to the extent that it is capable of conforming),
compile with -std=c++14 -pedantic-errors
1 2 3 4
int main ()
{
char *str[3]={ "red", "yellow", "white" };
}
LLVM clang++: error: ISO C++11 does not allow conversion from string literal to 'char *'
GNU g++: error: ISO C++ forbids converting a string constant to 'char*' http://coliru.stacked-crooked.com/a/b02063c0df1d0d65