Skip to content

Commit 5f05a6f

Browse files
committed
added clarity to null statement
1 parent 7a40958 commit 5f05a6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Ch1_Tutorial_Introduction/countchar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ int main(){
77
for (nc = 0; getchar != EOF; ++nc) //weird for loop that kinda goes forever?
88
; //do nothing within the loop
99
//isolated semicolon to indicate nothing
10+
//aka 'null statement'
1011
printf("%.0f\n", nc);
1112
}

Ch1_Tutorial_Introduction/stdin_test.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
// program ends when end of file character is passed (CTRL+D)
55
int main()
66
{
7-
int c; // store the character as an integer
8-
9-
7+
int c; // store the character as an integer
8+
109
while ( (c=getchar()) != EOF){ // while the user has not entered an EOF char
11-
putchar(c); // print the character they enter
10+
putchar(c); // print the character they enter
1211
}
1312
printf("You entered an EOF char\n");
1413
putchar(EOF);

0 commit comments

Comments
 (0)