Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Need Help (http://www.go4expert.com/forums/need-help-t8095/)

bashamsc 3Jan2008 20:54

Need Help
 
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++.

Alazer 8Jan2008 15:25

Re: Need Help
 
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);


All times are GMT +5.5. The time now is 00:22.