User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,539 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,185 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2629 | Replies: 5
Reply
Join Date: Jul 2004
Posts: 31
Reputation: Sukhbir is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Sukhbir Sukhbir is offline Offline
Light Poster

functions

  #1  
Aug 12th, 2004
EXplain me about these function

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

tell me what function i use for flushing a input bufer in c and c++;
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2004
Posts: 6
Reputation: payam is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
payam payam is offline Offline
Newbie Poster

Re: functions

  #2  
Aug 12th, 2004
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: functions

  #3  
Aug 12th, 2004
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
Reply With Quote  
Join Date: Apr 2004
Posts: 3,755
Reputation: Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light Dave Sinkula is a glorious beacon of light 
Rep Power: 17
Solved Threads: 147
Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: functions

  #4  
Aug 12th, 2004
Originally Posted by freesoft_2000
fflush(stdin); // This is to flush the input
Wrong!
http://www.eskimo.com/~scs/C-faq/q12.26.html
Reply With Quote  
Join Date: Jul 2004
Posts: 31
Reputation: Sukhbir is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Sukhbir Sukhbir is offline Offline
Light Poster

Re: functions

  #5  
Aug 13th, 2004
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.
Reply With Quote  
Join Date: Aug 2004
Posts: 11
Reputation: stg110 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
stg110 stg110 is offline Offline
Newbie Poster

Re: functions

  #6  
Aug 14th, 2004
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 ?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 4:54 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC