Need Help

Discussion in 'C' started by bashamsc, Jan 3, 2008.

  1. bashamsc

    bashamsc New Member

    Joined:
    May 22, 2007
    Messages:
    51
    Likes Received:
    7
    Trophy Points:
    0
    Location:
    chennai
    I have a string 13/06/07


    but i have to convert it into integer and 13 , 06 and 07 has to be separated in c++.
     
  2. Alazer

    Alazer New Member

    Joined:
    Oct 23, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    you can use "sscanf" , "man sscanf " for an example .
    Here i give you a simple Example:
    char* strTemp = "123,456,789";
    int iFisrt = 0;
    int iSecond = 0;
    int iThird =0;
    scannf(strTemp, "%d,%d,%d",&iFirst, &iSecond, &iThird);
     

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