cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How to find the places of a certain char
How to find the places of a certain character in a text?
Nov 29, 2021 at 5:31pm UTC
fcoder0
(1)
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 UTC
Ganado
(6810)
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 UTC
Topic archived. No new replies allowed.