Jan 5, 2001 #1 SteveD73 Programmer Jan 5, 2001 109 GB Hello I have a CString like the following: szTest = "673845" I need to break it down into three variables like so: int x = 67; int y = 38; int z = 45; Does anyone know how to do this? Thanks
Hello I have a CString like the following: szTest = "673845" I need to break it down into three variables like so: int x = 67; int y = 38; int z = 45; Does anyone know how to do this? Thanks
Jan 5, 2001 #2 palbano Programmer Oct 9, 1998 4,341 US Well there are different ways you can do this, here is one. int x = szText.Mid(0,2); int y = szText.Mid(2,2); int z = szText.Mid(4); Good luck -pete Upvote 0 Downvote
Well there are different ways you can do this, here is one. int x = szText.Mid(0,2); int y = szText.Mid(2,2); int z = szText.Mid(4); Good luck -pete
Jan 8, 2001 #3 sanjay123 Programmer Apr 11, 2000 19 IN I think strings need to be converted into numerical values int x = atoi(szText.Mid(0,2)); int y = atoi(szText.Mid(2,2)); int z = atoi(szText.Mid(4)); incase of Unicode Strings better use mfc Macro's int x = atoi(W2A(szText.Mid(0,2))); int y = atoi(W2A(szText.Mid(2,2))); int z = atoi(W2A(szText.Mid(4))); Upvote 0 Downvote
I think strings need to be converted into numerical values int x = atoi(szText.Mid(0,2)); int y = atoi(szText.Mid(2,2)); int z = atoi(szText.Mid(4)); incase of Unicode Strings better use mfc Macro's int x = atoi(W2A(szText.Mid(0,2))); int y = atoi(W2A(szText.Mid(2,2))); int z = atoi(W2A(szText.Mid(4)));
Nov 20, 2002 #4 dllCoRupT626 Programmer Oct 15, 2002 12 US sanjay123 you've made me the happiest programmer on this planet! i've been searching for over 7 hours for a function to convert strings to ints THANKS A BUNCH later... Upvote 0 Downvote
sanjay123 you've made me the happiest programmer on this planet! i've been searching for over 7 hours for a function to convert strings to ints THANKS A BUNCH later...