Skip to content

Commit

Permalink
Modified variable naming in examples to align with style guidelines.
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronGray1210 committed Nov 8, 2024
1 parent 3e8e54e commit 0d2d67b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/D-Modularity/functions-arrays-and-structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

Expand All @@ -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]);
}
Expand Down Expand Up @@ -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];
};

Expand All @@ -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]);
}
Expand Down Expand Up @@ -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];
};

Expand All @@ -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]);
}
Expand Down Expand Up @@ -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];
};

Expand All @@ -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]);
}
Expand Down Expand Up @@ -715,7 +715,7 @@ For example:
struct Student
{
int no;
int no_grades_filled;
int noGradesFilled;
float grade[4];
};

Expand All @@ -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]);
}
Expand Down

0 comments on commit 0d2d67b

Please sign in to comment.