Original Post
I've a question,how to make an array read a text file?
For example:
int Map[15][20] = {
3,3,3,3,4,5,5,5,5,6,2,2,1,10,10,8,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,8,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,8,8,8,8,8,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,7,7,7,7,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,7,7,7,7,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,10,0,7,7,10,0,
3,3,3,3,3,4,5,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,10,0,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,10,0,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,10,0,7,7,10,0};
I'm tryning to pass the vavule of this array for a text file,but when I do this:
int Mapa[15][20] =fopen("map.txt","w");
the code gives error(obivious).Can somebody help me?
For example:
int Map[15][20] = {
3,3,3,3,4,5,5,5,5,6,2,2,1,10,10,8,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,8,9,9,9,9,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,8,8,8,8,8,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,7,7,7,7,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,7,7,7,7,7,7,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,4,5,5,5,5,6,2,2,1,7,10,0,7,7,10,0,
3,3,3,3,3,4,5,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,10,0,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,10,0,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,0,10,7,7,10,0,
3,3,3,3,3,3,4,5,5,6,2,2,1,7,10,0,7,7,10,0};
I'm tryning to pass the vavule of this array for a text file,but when I do this:
int Mapa[15][20] =fopen("map.txt","w");
the code gives error(obivious).Can somebody help me?