1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Please help - Problem with scanf

Discussion in 'C' started by yoavagami, Jan 1, 2008.

  1. yoavagami

    yoavagami New 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.
     
  2. b.t.e

    b.t.e New Member

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

    float num; // double

    scanf("%f",&num);

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

    yoavagami New Member

    Its not from a file.. is there some way to exept the "ENTER"? Thanks..
     
  4. shabbir

    shabbir Administrator Staff Member

    Then when you want to break?
     
  5. yoavagami

    yoavagami New 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..)
     

Share This Page