From 8222545df24aa1428d4f80e07d5eeda5b8a056ce Mon Sep 17 00:00:00 2001 From: Tra Knight <43129177+TraKnight@users.noreply.github.com> Date: Wed, 29 Sep 2021 19:07:48 -0400 Subject: [PATCH] Update main.cpp Changed the length number of 3 to reference the outer for loop iterator for size of index. Shows a visual representation of how nested for loops iterators can rely on one another for traversal. --- .../main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lesson 1/Activity 2 - Define a Bi-dimensional Array and Initialize its Elements/main.cpp b/Lesson 1/Activity 2 - Define a Bi-dimensional Array and Initialize its Elements/main.cpp index 12e423d..a8fa09f 100644 --- a/Lesson 1/Activity 2 - Define a Bi-dimensional Array and Initialize its Elements/main.cpp +++ b/Lesson 1/Activity 2 - Define a Bi-dimensional Array and Initialize its Elements/main.cpp @@ -5,7 +5,7 @@ int main() { int foo[3][3]; for (int x = 0; x < 3; x++){ - for (int y = 0; y < 3; y++){ + for (int y = 0; y < x-1; y++){ foo[x][y] = x + y; } } @@ -16,4 +16,4 @@ int main() } } -} \ No newline at end of file +}