How to count line of code in text file or file .cpp
(this .txt file or .cpp file is the input file of program)
and what's function for count line of only mark code
for example of this code(file input) , I want to count only "do" function that have mark //DO
The answers of program for read this code have to show "4"
I take it this is a school assignment so I won't give away the answer.
If you want to count the lines of the do I'll give you a couple hints
1) What defines a line of code?
2) What defines the starting and ending of the do loop? Hint you'll need to use a stack w/ push & pop to track when you see the start marker for the do area because you might see other start markers and/or end markers before you reach the actual do end marker.