+ 1
String array
Hello everyone, can you help me. I want to break a sentence to words. How can I transfer them into string array and declare it?
3 odpowiedzi
+ 3
This code works without knowing how long is an input string:
https://code.sololearn.com/c1V2mmgE7qNv/?ref=app
+ 1
This will help you.
https://code.sololearn.com/cYJmgppdI5mn/?ref=app
Addendum: this was only meant to be an idea of how it could be done and not a solution.
0
Martin, yes I agree with you. My basic question is how to drive all words into one string array. With this I shall inicial and declare string array with these words.
I know that it is possible to break string with fundamental string functions such as: length, find, substr, erase.
With your answer I am satisied because you don't know how long could be a string. It can be few words or thousend.
But for now I still haven't known the header sstream so I must to check it out more carefully.