Please help - Problem with scanf

yoavagami's Avatar, Join Date: Jan 2008
Newbie Member
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.
0
b.t.e's Avatar
Newbie Member
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);
}
0
yoavagami's Avatar, Join Date: Jan 2008
Newbie Member
Its not from a file.. is there some way to exept the "ENTER"? Thanks..
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Then when you want to break?
0
yoavagami's Avatar, Join Date: Jan 2008
Newbie Member
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..)