casting CString to int
-
I have a CString of 6 numbers how can i cast into one int variable so i can compare it with different numbers. /\|-||\/|/\|)
-
int i;
CString str = "32";
sscanf(str, "%d", &i);
ASSERT(i == 32);
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
One more thing... can i do this without the Assert coz i don't know the value of str in my program thx anyway /\|-||\/|/\|)
-
certainly,
ASSERT()
was just here to show you that aftrer treatment, the int contains the string's value...
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
I have a CString of 6 numbers how can i cast into one int variable so i can compare it with different numbers. /\|-||\/|/\|)
-
I have a CString of 6 numbers how can i cast into one int variable so i can compare it with different numbers. /\|-||\/|/\|)
-
Rookieee wrote: int i; CString str = "32"; sscanf(str, "%d", &i);ASSERT(i == 32); int i; CString str = "32"; sscanf(str, "%d", &i);ASSERT(i == 32); watz wrong with this ^? vivek