hi. i wud like to scan the inputs until EOF ...how would i do that
hi. i wud like to scan the inputs until EOF ...how would i do that
On the assumption that "scan the inputs" means something, you would do ... whatever it is you intend to do ... until it fails. (Technically, it could fail for other reasons, like bad input, but you can check afterwards whether .eof is true.)
ignore the cases for bad input...i just need to identify end of input
untlii end of input
cin>>x;
should i do
while(.eof==true)
cin>>x;
let me have the code to do it
You need to read while the read is good. So while (cin >> x).
it doesnt work
fine do u know wat does rawinput()[-1] in python do...tat ll solve me the prob..
if yes i shud be able to do in c++
As a matter of fact, it (the while statement, I mean) does in fact work. You are typing EOF yourself with Ctrl-Z on Windows/Ctrl-D on *nix, yes? If you just want one line, that's something else. (Edit: You may have to press enter after EOF, of course, if you are typing this yourself.)
Last edited by tabstop; 01-23-2009 at 10:16 PM.