I'm using Dev-C++
Basically, I have a text file with lines similiar to the following:



zSectionone
olo
loo
ool
ool
zSectiontwo
olo
olo
loo
ool
zSectionthree
olo
loo
loo
ool

i need to read from the text file stats.txt each line... when it hits a line beginning with z, then it will increase my counter variable c by 1. this is where i need the help at, note there will not always be 3 lines with z, so it needs to continue until there is nothing left to read.

if the line does not begin with z, then it count how many olo, loo, and ool's there are and set the number to olo(c), loo(c), and ool(c) respectively. just a little more info if you want to show how you would go about this, i can figure it out myself, but might not be too efficient.