Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

EOF is returned by functions that can return a valid character. So this rules out all the values in 0x00-0xFF (0 would have been a nice choice for EOF but how do you read nul bytes?). -1 is the logical solution (note that getchar returns an int so -1 != 0xFF).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: