functions

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2004
Posts: 31
Reputation: Sukhbir is an unknown quantity at this point 
Solved Threads: 0
Sukhbir Sukhbir is offline Offline
Light Poster

functions

 
0
  #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++;
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 6
Reputation: payam is an unknown quantity at this point 
Solved Threads: 0
payam payam is offline Offline
Newbie Poster

Re: functions

 
0
  #2
Aug 12th, 2004
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: functions

 
0
  #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 Quick reply to this message  
Join Date: Apr 2004
Posts: 4,461
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 254
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: functions

 
0
  #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
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 31
Reputation: Sukhbir is an unknown quantity at this point 
Solved Threads: 0
Sukhbir Sukhbir is offline Offline
Light Poster

Re: functions

 
0
  #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 Quick reply to this message  
Join Date: Aug 2004
Posts: 11
Reputation: stg110 is an unknown quantity at this point 
Solved Threads: 0
stg110 stg110 is offline Offline
Newbie Poster

Re: functions

 
0
  #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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3107 | Replies: 5
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC