cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Subtract integer from string
Subtract integer from string
Jan 10, 2012 at 2:04pm UTC
juosja
(1)
Hi! I'm sorry if this topic is repeat.
I want to subtract 4567 from this string "the number is 4567 and it's not ok" and then convert it to an int.
How can i do that with the std?
Thanks a lot!
Jan 10, 2012 at 2:18pm UTC
Moschops
(7244)
Break string into individual words. This is commonly called
tokenizing
and there is much to read about it on the web.
Check each string to see if it is a number. This is also a commonly solved problem that you'll have no trouble tracking down.
When you find one that is, convert it to int.
Last edited on
Jan 10, 2012 at 2:20pm UTC
Topic archived. No new replies allowed.