How to find the places of a certain character in a text?

Nov 29, 2021 at 5:31pm
I want to locate 0 characters in a text. For example our text is "03250150", I want it to type 0, 4 and 7 in terminal respectively. How can I do this?
Nov 29, 2021 at 5:43pm
Use a for loop; if str[i] == '0', print i.

Tutorial on control structures/loops: http://cplusplus.com/doc/tutorial/control/

Show us an attempt, and then we can critique it.
Last edited on Nov 29, 2021 at 5:46pm
Topic archived. No new replies allowed.