Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Please help - Problem with scanf (http://www.go4expert.com/forums/help-scanf-t8066/)

yoavagami 1Jan2008 22:56

Please help - Problem with scanf
 
I need to write a code that get as an input a double, and if the user puts an "ENTER", it will continue, but the scanf function waits untill the user puts anything exept "ENTER".
Thank you.

b.t.e 2Jan2008 02:09

Re: Please help - Problem with scanf
 
Quote:

Originally Posted by yoavagami
I need to write a code that get as an input a double, and if the user puts an "ENTER", it will continue, but the scanf function waits untill the user puts anything exept "ENTER".
Thank you.

does the user takes the inputs from a file?
if so ..

float num; // double

scanf("%f",&num);

while( !EOF ) // !EndOfFile
{
scanf("%f",&num);
}

yoavagami 2Jan2008 02:49

Re: Please help - Problem with scanf
 
Its not from a file.. is there some way to exept the "ENTER"? Thanks..

shabbir 2Jan2008 17:11

Re: Please help - Problem with scanf
 
Then when you want to break?

yoavagami 2Jan2008 19:15

Re: Please help - Problem with scanf
 
I need to get input a double, and if the user puts "ENTER", it will continue (when I do scanf(%lf,&num); it "waits" untill I input something and just after that it will continue..
(I'm not using files..)


All times are GMT +5.5. The time now is 21:41.