|
-
Oct 7th, 2000, 08:12 AM
#1
Thread Starter
Fanatic Member
I've got a number from a textbox which is in the form of a string (from string.h, not a char * thing) and it has quite a few methods and stuff, and I was wondering which one converts the string to a, for example, float or long int ?
I couldn't find anything on MSDN, and none of the methods say 'toNumber' or anything. Please, it is quite important since what use is a calculator project which doesn't bloody well know what numbers we're dealing with?
Thanks,
le MOI
-
Oct 7th, 2000, 11:07 AM
#2
Monday Morning Lunatic
You mean the STL string class?
In that case, try atof/atoi with the c_str() member function of your string object.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 7th, 2000, 12:25 PM
#3
Thread Starter
Fanatic Member
Originally posted by parksie
You mean the STL string class?
Errr. Probably?
Thanks for the advice. I know about ato-x- and but I didn't know that c_str changed the string into something useful.
Thanks again, Mikey boy,
DJ Da Arse
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
|