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

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?
Use a for loop; if str[i] == '0', print i.

Tutorial on control structures/loops:

Show us an attempt, and then we can critique it.
Last edited on
Topic archived. No new replies allowed.