1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ISSUE in using gets( ) with switch case..

Discussion in 'C' started by arvind_khadri, Sep 4, 2007.

  1. arvind_khadri

    arvind_khadri New Member

    Joined:
    Sep 4, 2007
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    0
    am having trouble using gets( ) in switch case...its not takin in the string at all...its actually skippin tat statement...but whereas if i use scanf( ) the code works.....wat probably is happening inside????
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    Show your code. Be sure and put in inside code tags (see the "Before you make a query" thread). You should never use gets (). It doesn't allow you control the maximum length, thus is often the cause of buffer overflows. You can use fgets (), instead.
     

Share This Page