diff options
| author | Connor McDowell <[email protected]> | 2024-02-15 14:16:20 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-15 14:16:20 -0800 |
| commit | ea8d709b2a20bee271e7d4db8fd857e51caad3f7 (patch) | |
| tree | 2302c97dff2a79336f4677a0d19b56991f12fe39 | |
| parent | LITERALLY NOTHING (diff) | |
| download | in-class-exercise-11-connormcdowell275-ea8d709b2a20bee271e7d4db8fd857e51caad3f7.tar.xz in-class-exercise-11-connormcdowell275-ea8d709b2a20bee271e7d4db8fd857e51caad3f7.zip | |
following lecture again
| -rw-r--r-- | Project1/program.cpp | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index 510e775..d40eeb1 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -6,32 +6,35 @@ #include <iostream> #include <ostream> -//#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 +/*#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; +}
\ No newline at end of file |