Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mooism2
on Dec 20, 2008
|
parent
|
context
|
favorite
| on:
Will stdio outlive us?
The correct way is
int ch; while ((ch = getchar()) != EOF) { // ... }
If ch is declared as a char, it's buggy regardless of whether it's signed or not, it's just the failure modes are different.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: