This shows you the differences between two versions of the page.
|
c:stdio.h:getchar [2013/01/22 22:02] 127.0.0.1 external edit |
c:stdio.h:getchar [2024/02/16 01:05] (current) |
||
|---|---|---|---|
| Line 21: | Line 21: | ||
| int main ( void ) { | int main ( void ) { | ||
| - | int chars; | + | int chars; |
| - | printf("type in . to end your input : "); | + | printf("type in . to end your input : "); |
| - | while ((chars = getchar()) != '.' ){ | + | while ((chars = getchar()) != '.' ){ |
| - | putchar(chars); | + | putchar(chars); |
| } | } | ||
| - | return 0; | + | return 0; |
| } | } | ||
| </code> | </code> | ||
| Line 35: | Line 35: | ||
| user@host:~$ ./getchar | user@host:~$ ./getchar | ||
| type in . to end your input : Test 1234. | type in . to end your input : Test 1234. | ||
| - | Test 123 | + | Test 1234 |