Hi everyone..i'm new c++ programming and i would like to know if its posible to convert a string to a vector array...(Eg string s = "Hello everyone" array a[1]='H', a[2]='e'....)I need a vector array because i do not know what my string will be...it will change everytime...If it is posible i would please like to know the solution...
tlly
0
Newbie Poster
Recommended Answers
Jump to Postwhy not just index into the string? You don't need a vector just to get a character from the string object.
std::string s = "Hello World"; for(size_t i = 0; i < s.length(); i++) { char c = s[i]; cout << c << "\n"; }
If you …
All 4 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
tlly
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
Grunt
commented:
it's not neccesary to comment on everything. above post eas sufficient
+0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.