FragSax 0 Newbie Poster

I'm having a small problem with a map format that I'm making. It's essentially simple a char*[32] with each line of characters being stored in it for instance here's a hard coded version of the map and how I'm storing it:

int main () {
	char *mapdata[32];
	
	mapdata[0]  =  "1111111111111111111111111111111";
	mapdata[1]  =  "1.............................1";
	mapdata[2]  =  "111111111111111111....$.....111";
	mapdata[3]  =  "1111111111111.................1";
	mapdata[4]  =  "1....................1........1";
	mapdata[5]  =  "111111111...11111.............1";
	mapdata[6]  =  "        1...1   111111111111111";
	mapdata[7]  =  "        11D11                  ";
	mapdata[8]  =  "         1.1                   ";
	mapdata[9]  =  "        1N.N1         111      ";
	mapdata[10] =  "       1NN.NN1       1NNN1     ";
	mapdata[11] =  "       1NN.NN1      1c...c1    ";
	mapdata[12] =  "        1N.N1        1www1     ";
	mapdata[13] =  "         1.1         1WWW1     ";
	mapdata[14] =  "      1  1D1  1      1WWW1     ";
	mapdata[15] =  "     1c111.111c1      1W1      ";
	mapdata[16] =  "     1.........1      1W1      ";
	mapdata[17] =  "     1.........1      1W1      ";
	mapdata[18] =  "     1wwwwwwwww1      1W1      ";
	mapdata[19] =  "     11111W11111      1W1      ";
	mapdata[20] =  "         1W1          1W1      ";
	mapdata[21] =  "      1111W111111111111W1      ";
	mapdata[22] =  "      1WWWWWWWWWWWWWWWWW1      ";
	mapdata[23] =  "      1WWWWWWW11111111111      ";
	mapdata[24] =  "      1111w1111                ";
	mapdata[25] =  "        1www1                  ";
	mapdata[26] =  "         1.1                   ";
	mapdata[27] =  "        1...1                  ";
	mapdata[28] =  "        1w.w1                  ";
	mapdata[29] =  "        1w.w1                  ";
	mapdata[30] =  "        1www1                  ";
	mapdata[31] =  "         111                   ";

	return 0;
}

I was wondering how could I essentially do that same as shown above but loading it from a file instead of just hard coding it all. Also it's worth noting that while it's all written in C++ I'm using the standard C functions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.