From 453d23ecaf3300733e3512f5e6d81f9d396cdc4f Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Mon, 12 Feb 2024 18:25:03 -0800 Subject: notes --- Project1/main.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Project1/main.cpp (limited to 'Project1/main.cpp') diff --git a/Project1/main.cpp b/Project1/main.cpp new file mode 100644 index 0000000..6b180d9 --- /dev/null +++ b/Project1/main.cpp @@ -0,0 +1,37 @@ +// Name: Connor McDowell +// date: 2/12/2024 +// class: CST116 +// reason: inclass exercise 11, 2d arrays + +#include +#include + +#define ROW 3 +#define COLUMN 4 + +using std::cin; +using std::cout; +using std::endl; + +int matrix[ROW][COLUMN]{ {1,2,3,4}, {5,6,7,8}, {9,10,11,12} }; + +int print2DArray(int(&matrix)[ROW]{COLUMN}) +{ + 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; +} \ No newline at end of file -- cgit v1.2.3