The nicest solution (in terms of future flexibility), is to encode your data in either a bitmap image or a text file.
Alternatively, if you just want to initialize an array of arrays:
// made smaller (4x4) so it fits in a post neatly...
string MAP[4][4] = {
{"|I|", "|I|", "|I|", "|I|" },
{"|I|", "|I|", "|I|", "|I|" },
{"|I|", "|I|", "|I|", "|I|" },
{"|I|", "|I|", "|I|", "|I|" }
};
But you're right, you can't initialize one 'row' at a time. It has to be done all at once.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
Post the full line of code where you get the error.
But, it looks like you have the double quote and comma in the wrong order in that excerpt.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
Also, if you have a mismatch between the number of items you say are in the array, and the number of items you actually put in the array, you'll get an error that says something along the lines of "too many initializers".
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64