From 0d2d67bfa5f6d819328e9d2258d0cfe41ea87fa5 Mon Sep 17 00:00:00 2001 From: Cameron Gray Date: Fri, 8 Nov 2024 10:09:41 -0500 Subject: [PATCH] Modified variable naming in examples to align with style guidelines. --- .../functions-arrays-and-structs.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/D-Modularity/functions-arrays-and-structs.md b/docs/D-Modularity/functions-arrays-and-structs.md index 2d265e8..824bbb7 100644 --- a/docs/D-Modularity/functions-arrays-and-structs.md +++ b/docs/D-Modularity/functions-arrays-and-structs.md @@ -379,7 +379,7 @@ Consider the following program. Note that the `Student` structure includes a mem struct Student { int no; - int no_grades_filled; + int noGradesFilled; float grade[4]; }; @@ -398,7 +398,7 @@ void display(const struct Student st) int i; printf("Grades for %d\n", st.no); - for (i = 0; i < st.no_grades_filled; i++) + for (i = 0; i < st.noGradesFilled; i++) { printf("%.1f\n", st.grade[i]); } @@ -429,7 +429,7 @@ In the following example, the data stored in `harry` does not change after the f struct Student { int no; - int no_grades_filled; + int noGradesFilled; float grade[4]; }; @@ -456,7 +456,7 @@ void display(const struct Student st) int i; printf("Grades for %d\n", st.no); - for (i = 0; i < st.no_grades_filled; i++) + for (i = 0; i < st.noGradesFilled; i++) { printf("%.1f\n", st.grade[i]); } @@ -519,7 +519,7 @@ In the following program, we pass the address of harry to `set()`: struct Student { int no; - int no_grades_filled; + int noGradesFilled; float grade[4]; }; @@ -546,7 +546,7 @@ void display(const struct Student st) int i; printf("Grades for %d\n", st.no); - for (i = 0; i < st.no_grades_filled; i++) + for (i = 0; i < st.noGradesFilled; i++) { printf("%.1f\n", st.grade[i]); } @@ -612,7 +612,7 @@ Consider passing `harry` by address to function `display()` as well: struct Student { int no; - int no_grades_filled; + int noGradesFilled; float grade[4]; }; @@ -639,7 +639,7 @@ void display(const struct Student* st) int i; printf("Grades for %d\n", (*st).no); - for (i = 0; i < (*st).no_grades_filled; i++) + for (i = 0; i < (*st).noGradesFilled; i++) { printf("%.1f\n", (*st).grade[i]); } @@ -715,7 +715,7 @@ For example: struct Student { int no; - int no_grades_filled; + int noGradesFilled; float grade[4]; }; @@ -742,7 +742,7 @@ void display(const struct Student* st) int i; printf("Grades for %d\n", st->no); - for (i = 0; i < st->no_grades_filled; i++) + for (i = 0; i < st->noGradesFilled; i++) { printf("%.1f\n", st->grade[i]); }