|
-
Dec 31st, 2002, 02:36 PM
#1
Thread Starter
Frenzied Member
!= -1 exit while loop?
while ( (letter= cin.get () ) != -1)
Would that work correctly? What I mean is the != -1 part used to exit the while loop.
I am reading this college book on C++ and they used EOF instead of -1. Which one is better? End of File just seemed harder to tell what to press to me.
Last edited by aewarnick; Dec 31st, 2002 at 03:15 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|