943,871 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3276
  • C++ RSS
Aug 12th, 2004
0

functions

Expand Post »
EXplain me about these function

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

tell me what function i use for flushing a input bufer in c and c++;
Similar Threads
Reputation Points: 11
Solved Threads: 0
Light Poster
Sukhbir is offline Offline
31 posts
since Jul 2004
Aug 12th, 2004
0

Re: functions

Reputation Points: 10
Solved Threads: 0
Newbie Poster
payam is offline Offline
6 posts
since Aug 2004
Aug 12th, 2004
0

Re: functions

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
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Aug 12th, 2004
0

Re: functions

Quote originally posted by freesoft_2000 ...
fflush(stdin); // This is to flush the input
Wrong!
http://www.eskimo.com/~scs/C-faq/q12.26.html
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004
Aug 13th, 2004
0

Re: functions

Quote originally posted by freesoft_2000 ...
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.
Reputation Points: 11
Solved Threads: 0
Light Poster
Sukhbir is offline Offline
31 posts
since Jul 2004
Aug 14th, 2004
0

Re: functions

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 ?
Reputation Points: 11
Solved Threads: 0
Newbie Poster
stg110 is offline Offline
11 posts
since Aug 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC