post  Using cin to get user input.

firedraco (2048)   Link to this post
I'm not sure if you could do this, but could you possibly overload the >> operator for cin and make it call getline()?
Xyzk (14)   Link to this post
Well I`d only like to ask whether there is any difference in speed. I mean, if I was doing a problem where there are no chances of getting the wrong values, which would be faster?
Zaita (2112)   Link to this post
In reality I'd hardly even consider the speed difference between the 2 approaches. If your worried about speed, then the speed of a cin/cout should be the last place your looking.
Zaita (2112)   Link to this post
Update: Added information about cin not removing newline characters and mixing cin >> var; with getline();

Pages: [1] [2]


This topic is archived - New replies not allowed.