Hmm.. didn't my
latest display of such a solution give you any idear ??
The theory in it, is to dislay the percentage as beeing:
(<amount done>*100)/<total amount>
The question on how to be certain how much the total amount is, thats a good one, if it's reading from a file you could probably find a clever way of guessing it from some combination of
tellg() and
seekg(). Something which theoreticaly might sound like:
Code:
1) open file
2) start = tellg()
3) seekg(0, ois::end)
4) end = tellg()
5) seekg(0, ios::beg)
6) while(!eof)
read input from file
cur = tellg();
percent = ((cur - start)*100/(end - start));
display_percentage(percent);
do stuff with input
7) close file.