aboutsummaryrefslogtreecommitdiff
path: root/Project1/program.cpp
blob: d40eeb12380d3e06a78f2303eb61afcc8d369c74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Name: Connor McDowell
// date: 2/12/2024
// class: CST116
// reason: inclass exercise 11, 2d arrays

#include <iostream>
#include <ostream>

/*#define ROW 3
#define COLUMN */

using std::cin;
using std::cout;
using std::endl;

constexpr size_t ROW = 3;
constexpr size_t COLUMN = 4;

int matrix[3][4]{ {1,2,3,4}, {5,6,7,8}, {9,10,11,12} };

int print2DArray(int(&matrix)[3][4])
{
	for (auto i = 0u; i < ROW; ++i)
	{
		for (auto j = 0u; j < COLUMN; ++j)
		{
			cout << matrix[i][j] << " ";
		}
	}
	return 0;
}

int main()
{

	print2DArray(matrix);


	return 0;
}