file i/o

i never really understood file I/O and i never really needed it till now in need to store this array:
1
2
3
4
5
6
7
8
int maptiles[8][8] = {{0, 0, 0, 0, 0, 0, 0, 0},
			{0, 0, 0, 0, 0, 0, 0, 0},
			{6, 6, 6, 6, 6, 6, 6, 6},
			{0, 0, 0, 0, 0, 0, 0, 0},
			{0, 0, 0, 0, 0, 0, 0, 0},
			{0, 0, 0, 0, 0, 0, 0, 0},
			{0, 0, 0, 0, 0, 0, 0, 7},
			{0, 0, 0, 0, 0, 0, 7, 7}};

in a .txt file and then bring it back into my program as an array
how do i do that?
Use loops to iterate through all elements of your array and print those number to a file separated by spaces
http://www.cplusplus.com/doc/tutorial/files/
Topic archived. No new replies allowed.