|
-
Dec 5th, 2007, 12:16 AM
#1
Thread Starter
PowerPoster
int value through string
Hi all,
I have a string(not a CString), actually a file path. As an example,
Code:
c:\Test\MyProject\G00062_002_01.srf
Then in following way get some data.
Code:
string FullPath = c:\Test\MyProject\G00062_002_01.srf
string filePath = FullPath.GetFileTitle();
string groupID;
string sessionId;
string partID;
groupID = filePath.substr(1, 5);
sessionId = filePath.substr(7, 3);
partID = filePath.substr(11, 2);
So my outputs are 00062, 002, 01 respectively as string type. I want to add those values in a database as int type. How should I do this conversion.
Where I'm confusing is that, outputs are in string format. But actually there are some integers.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|