CString problem
-
Hi! i have a dialogbased mfc-programm. in this programm i have several cstrings like 155 180 210 .......... with a lot of rows and columns. now i want to have every number as a single integer. like int One=155; int Two=180;..... is it possible??? thanks for every reply. MFC
-
Hi! i have a dialogbased mfc-programm. in this programm i have several cstrings like 155 180 210 .......... with a lot of rows and columns. now i want to have every number as a single integer. like int One=155; int Two=180;..... is it possible??? thanks for every reply. MFC
Use
AfxExtractSubString()
to pull out each group of digits, then_ttoi()
to convert to integers. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm -
Use
AfxExtractSubString()
to pull out each group of digits, then_ttoi()
to convert to integers. --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helmi searched the function
AfxExtractSubString
in the msdn, but i found nothing. :confused: can you explain the use? :~ my string is called:CString text;
and it contains for example: 120 111 34 44 (between every number is a blank) thanks MFC -
i searched the function
AfxExtractSubString
in the msdn, but i found nothing. :confused: can you explain the use? :~ my string is called:CString text;
and it contains for example: 120 111 34 44 (between every number is a blank) thanks MFCMFC is the Best wrote: 120 111 34 44 (between every number is a blank) Why dont you just simply use
CString::Find(' ', nStart)
? So you can iterate over the whole Line and by remembering the result ofFind()
you can reuse it in the nextFind()
. With CString::Mid(), you get the portion of the Text between the two finds.