K
K
KaZr2018-12-08 23:03:13
C++ / C#
KaZr, 2018-12-08 23:03:13

How to split a string into words in c++?

How to split a string into words so that later you can count the number of characters, etc. in the word? Without using pointers
char str[] = "So she was";

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Melnikov, 2018-12-08
@BacCM

stingstream ss(str);  используем строковый поток
string s;
ss >> s; // Вынули слово, повторяем в цикле пока не кончатся

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question