cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Character Analyzing
Character Analyzing
May 21, 2010 at 10:10pm UTC
MottMan
(329)
Is it possible to analyze separate characters in a string or numbers in an integer/float/etc similar to slicing in Python. Any help would be appreciated.
May 21, 2010 at 10:21pm UTC
Athar
(4466)
For strings, you can use the index operator.
With str[0] you can access the first character, with str[1] the second one and so on.
To do the same with numbers it might be helpful to convert it to a string first.
May 21, 2010 at 10:26pm UTC
MottMan
(329)
Maybe this is a dumb question...
But how do you go about converting an integer to a string?
May 21, 2010 at 10:28pm UTC
m4ster r0shi
(2201)
http://cplusplus.com/articles/numb_to_text/
May 21, 2010 at 10:31pm UTC
MottMan
(329)
Thanks.
Topic archived. No new replies allowed.