954,224 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

functions

EXplain me about these function

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

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

Sukhbir
Light Poster
31 posts since Jul 2004
Reputation Points: 11
Solved Threads: 0
 
payam
Newbie Poster
6 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

hello everyone,

#include //Include this file in your header

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

I hope this helps you

Yours Sincerely

Richard West

freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
 
fflush(stdin); // This is to flush the input

Wrong! http://www.eskimo.com/~scs/C-faq/q12.26.html

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

hello everyone, #include //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.

Sukhbir
Light Poster
31 posts since Jul 2004
Reputation Points: 11
Solved Threads: 0
 

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

stg110
Newbie Poster
11 posts since Aug 2004
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You