We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69f5fe4 commit 4935490Copy full SHA for 4935490
chapter_1/exercise_1_09/copy_io.c
@@ -2,8 +2,15 @@
2
3
int main(void)
4
{
5
- char c;
6
- char last_c = '\0';
+ int c;
+ int last_c = '\0';
7
+ /*
8
+ If I use chars here instead of ints I get a "comparison
9
+ between pointer and integer gcc" warning.
10
+ getchar returns int not char.
11
+ Char type is de facto a 1-byte integer type.
12
+ Thank you for you solutions, they're helping me learn.
13
+ */
14
while ((c = getchar()) != EOF)
15
16
if (c != ' ' || last_c != ' ')
0 commit comments