Convert CString to Unsigned Long
-
I need to convert CString string to unsigned long. Exammple Need CString strPacket = "FFFFF400" to unsigned long Also any idea how to add a value to strPacket. What I mean is strPacket = "FFFFF400" + "4" = "FFFFF404";
-
I need to convert CString string to unsigned long. Exammple Need CString strPacket = "FFFFF400" to unsigned long Also any idea how to add a value to strPacket. What I mean is strPacket = "FFFFF400" + "4" = "FFFFF404";
Caoimh wrote: I need to convert CString string to unsigned long. Use
strtoul()
for this. Caoimh wrote: Also any idea how to add a value to strPacket. What I mean is strPacket = "FFFFF400" + "4" = "FFFFF404"; Assuming that strPacket is a CString object, this is perfectly valid:strPacket = "FFFFF400"; // assignment
strPacket += "4"; // concatenation
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
Caoimh wrote: I need to convert CString string to unsigned long. Use
strtoul()
for this. Caoimh wrote: Also any idea how to add a value to strPacket. What I mean is strPacket = "FFFFF400" + "4" = "FFFFF404"; Assuming that strPacket is a CString object, this is perfectly valid:strPacket = "FFFFF400"; // assignment
strPacket += "4"; // concatenation
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
I need to convert CString string to unsigned long. Exammple Need CString strPacket = "FFFFF400" to unsigned long Also any idea how to add a value to strPacket. What I mean is strPacket = "FFFFF400" + "4" = "FFFFF404";
I usually use
_wtol(cstringvar)
- Michael Haephrati מיכאל האפרתי