|
|
вернуться в форумC++ Input handling (end of input, that is) Hi, i'm having problems with the input of this task. How does my program know when the input is over? It would be very helpful if you could give me a code sample (only the input, not the actual task :) ). Something like: #what libraries the input needs while(way to know the input is over) { way_to_read (scanf, cin ...something else?) } Thanks, I believe if i get this part, the rest will work first time :) Re: C++ Input handling (end of input, that is) char s[1000]; while (scanf("%s", s) != EOF) { .... } Edited by author 19.09.2007 21:04 Re: read faq while(scanf("%s", s) == 1) Edited by author 17.08.2008 23:53 |
|
|