Answer the question
In order to leave comments, you need to log in
How to iterate character-by-character string variable c++?
In general, a sentence is written to the string variable. It is necessary to loop through it character by character for comparison. How to do it, preferably without a char variable?
Answer the question
In order to leave comments, you need to log in
string str = "Hello, world!";
for (auto c : str)
{
do_something(c);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question