File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Ch1_Tutorial_Introduction Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 44// program ends when end of file character is passed (CTRL+D)
55int 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 );
You can’t perform that action at this time.
0 commit comments