By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

How Do I Convert String To Int

P: n/a
How do I convert a C++ string (as in "string thingy;" as opposed to "char
thingy[10];") to an integer? I know how to use C atoi() and strtol() but I
get an compile error. Can anyone help? The simple answer is to initialize
thingy as a C "char" but it needs to be a C++ "string" so I need to find out
how to convert to an int.
Apr 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Check the FAQ

http://www.parashift.com/c++-faq-lit....html#faq-39.1

"Divvy Ballacks" <de**@forty2004.freeserve.co.uk> wrote in message
news:11****************@lotis.uk.clara.net...
How do I convert a C++ string (as in "string thingy;" as opposed to "char
thingy[10];") to an integer? I know how to use C atoi() and strtol() but I
get an compile error. Can anyone help? The simple answer is to initialize
thingy as a C "char" but it needs to be a C++ "string" so I need to find
out how to convert to an int.

Apr 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.