0

EXplain me about these function

cin.clear();
cin.ignore();

tell me what function i use for flushing a input bufer in c and c++;

5
Contributors
5
Replies
6
Views
13 Years
Discussion Span
Last Post by stg110
0

hello everyone,

#include <conio.h> //Include this file in your header

fflush(stdin); // This is to flush the input

I hope this helps you

Yours Sincerely

Richard West

0

hello everyone,

#include <conio.h> //Include this file in your header

fflush(stdin); // This is to flush the input

I hope this helps you

Yours Sincerely

Richard West

//FROM MY SIDE
HELLO DEAR fflush() FUNCTION BUFFERED THE OUTPUT STREAM NOT INPUT STREAM.SO,U'R COMMENT IS NOT TECHNICALLY CORRECT.PLS REPLY ME SOON.

0

to flush input buffer u can
#include <conio.h>
void main ()
{
/* code */
getch() ; //take input from keyboard buffer before displaying in the screen
/*rest of code*/
}
is this the answer to your question ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.