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("G ENERAL", "CYCLE", "StringNotFound",szBufCYCL E, 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!
char szBufCYCLE[10];
int nCycle;
GetPrivateProfileString("G
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.