Array

343 324 sf
Last edited on
Can you create a two-dimensional array of ints?
Could try something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
	int my_md_array[10][10];
	for (size_t i = 0; i != 10; ++i) {
		for (size_t j = 0; j != 10; ++j) {
			my_md_array[i][j] = i;
		}
	}

	for (size_t i = 0; i != 10; ++i) {
		for (size_t j = 0; j != 10; ++j) {
			cout << my_md_array[i][j] << ' ';
		}
		cout << endl;
	}


I'm almost certain there's a way to use a range-for to print it easier, but I forget how, so if someone wants to throw that up, I wouldn't be too awful mad.
Thank you so much Yawzheek. It worked

thanks again for the help.
Topic archived. No new replies allowed.