Please help - Problem with scanf

Newbie Member
1Jan2008,22:56   #1
yoavagami's Avatar
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.
Newbie Member
2Jan2008,02:09   #2
b.t.e's Avatar
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);
}
Newbie Member
2Jan2008,02:49   #3
yoavagami's Avatar
Its not from a file.. is there some way to exept the "ENTER"? Thanks..
Go4Expert Founder
2Jan2008,17:11   #4
shabbir's Avatar
Then when you want to break?
Newbie Member
2Jan2008,19:15   #5
yoavagami's Avatar
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..)