Link to home
Start Free TrialLog in
Avatar of bert1
bert1

asked on

Convert string to integer problem!

I want nCycle to get the value 24 like szBufCYCLE has. What have I done wrong?

char szBufCYCLE[10];
int nCycle;
GetPrivateProfileString("GENERAL", "CYCLE", "StringNotFound",szBufCYCLE, sizeof(szBufCYCLE)-1, lpszFileName);
MessageBox(szBufCYCLE, "Cycle", MB_OK); //Shows 24
nCycle = (int) szBufCYCLE;
char T[10];
MessageBox(itoa(nCycle, T, 10), "n", MB_OK);
//Shows 1324975 (something that is not 24)

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of bluemask
bluemask
Flag of Korea, Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial