dev syntax help

can some one explain this please?
need help !

1
2
3
  cin.get();
                        std::cin.ignore (std::numeric_limits<std::streamsize>::max(), '\n' );
                        i++;
discard everything until you see a line break.
because `.ignore()' also ask for a maximum number of steps, an "infinite" number is provided
closed account (S6k9GNh0)
cin.get() blocks and returns a character entry (which is after the user somehow feeds data to the stream which is normally after an enter press). Then the next line blocks until it sees an newline (generally after a user presses enter) and discards it. Then the next line increments i.
Last edited on
i didnt get it :( i shall be thankful if someone explains it in a simple and detailed way !
^thanx i got it :)

cin.get() wil force the output to remain on the screen
and .ignre.... will discard everyhtng when see a line break :)
> cin.get() wil force the output to remain on the screen
No, ¿the hell you are talking about?
The `.get()' method operates on the input stream, at most it would flush the output.
Last edited on
Topic archived. No new replies allowed.