0
How to split a string by whitespaces in C++?
I want to split a string, "This is a string", in separated words by whitespaces.
3 Réponses
+ 2
unlike java and python you can’t use split(), google the strtok() function for c and c++
+ 1
You can compare like so
If (character == ' ')
Then add word to array.
If you try to work out an implementation of your own i could provide some more help