|
>Then told to use cin.sync(), and it "worked".
This is one of the grey areas. The C++ standard in no way implies that cin.sync() will do what most people expect when they want to "flush" the stream. Unfortunately, many compilers implement it so that it does, and even Stroustrup explicitly (and incorrectly) states that it flushes the stream. The best solution is to avoid it entirely in favor of other solutions that are guaranteed to work as expected.
__________________
Even if the voices aren't real, they have some pretty good ideas.
|