Skip to content

Commit 3eeb22d

Browse files
1 parent 0d9f4d7 commit 3eeb22d

File tree

1 file changed

+5
-3
lines changed
  • Chapter 2:Types, Operators and Expressions/2.4 Declaration - const 9-0-5

1 file changed

+5
-3
lines changed

Chapter 2:Types, Operators and Expressions/2.4 Declaration - const 9-0-5/pedal 9-0-5.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ int string_length_2_(const char(*parameter)[5]) {
8080
return counter;
8181
}
8282

83-
// "When an array name is passed to a function, the function can at its convenience believe that
84-
// it has been handed either an array or a pointer, and manipulate it accordingly.
85-
// It can even use both notations if it seems appropriate and clear."[1]:114
83+
8684
int string_length_3_(char parameter[][5]) {
8785

8886
char* character = parameter;
@@ -116,6 +114,10 @@ int* count_lengths(char(*arr)[COLS], int rows) {
116114

117115
for (int i = 0; i < rows; i++) {
118116
int len = 0;
117+
118+
// "When an array name is passed to a function, the function can at its convenience believe that
119+
// it has been handed either an array or a pointer, and manipulate it accordingly.
120+
// It can even use both notations if it seems appropriate and clear."[1]:114
119121
for (int j = 0; j < COLS && arr[i][j] != '\0'; j++) {
120122
len++;
121123
}

0 commit comments

Comments
 (0)