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
separate a string to separate characters
separate a string to separate characters in an aray
Apr 30, 2010 at 2:55pm UTC
award982
(129)
Hey all!
I have a problem that i cant seem to solve.
How can i separate a string into separate characters ?
I only need to know how to read a separate character of a string and how to find out the length of the string.
Thanks in advance! :D
Apr 30, 2010 at 3:29pm UTC
Bazzy
(6281)
A string is made out of separate characters
here is an example
1
2
3
string s =
"Hello"
;
char
c = s[0];
// 'H'
unsigned
length = s.length();
// 5
Topic archived. No new replies allowed.