2D Arrays in C++.NET
-
Hi I am a budding C++ programmer with a question. I have declared and initialized a 2D array in the header file of my class as such: char *styles[][2] = { /*HTML Start and end tags for styles*/ {"", ""}, {"", ""}, {"", ""}, {"", ""}, {""}, {"
\n", ""}, {"
\n",""}, {"", ""}, {"", "
"}, {"
", "
"}, {"
", "
"}, {"
", "
"}, {"
", "
"}, {"
", "
"} }; Here are the error messages I get: error C2059: syntax error : '{' error C2334: unexpected token(s) preceding '{'; skipping apparent function body What gives? This is standard syntax is it not?:confused: TIA.
-
Hi I am a budding C++ programmer with a question. I have declared and initialized a 2D array in the header file of my class as such: char *styles[][2] = { /*HTML Start and end tags for styles*/ {"", ""}, {"", ""}, {"", ""}, {"", ""}, {""}, {"
\n", ""}, {"
\n",""}, {"", ""}, {"", "
"}, {"
", "
"}, {"
", "
"}, {"
", "
"}, {"
", "
"}, {"
", "
"} }; Here are the error messages I get: error C2059: syntax error : '{' error C2334: unexpected token(s) preceding '{'; skipping apparent function body What gives? This is standard syntax is it not?:confused: TIA.
I am moving the initialization to the .cpp file. Hang on...