Scanf wont wait for input

Discussion in 'C' started by Aizu, Sep 2, 2010.

  1. Aizu

    Aizu New Member

    Joined:
    Sep 2, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Seems like my scanf is skipping my user input. It is scanning for a character. I've looked at a few other places, hoping i can get a definite answer here. My code is:

    Code:
    scanf ("%c", start);
    if (start=='s' || start=='S'){
    //Run start functions...
    }
    the variable start is a character

    Again, the issue is that my program hits this line of code, skips the user input, and displays my else statement.

    Any / all help is appreciated.
     
  2. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    http://www.techgeek.in
    who will give '&' before the start variable?? first refer to the syntax of scanf then query....
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice