Hi. I have a program that reads a file, modifies the data, then writes it back into another file. I wanted to add a little feature which is the percentage complete. I have a basic view of how to do it, but I'm sure there's a better way.
This is the way I thought of:
-initialize the variable as 0.
-output it as the percentage.
-check size of writing file and divide by size reading file multiplied by 100.
-output '\b' twice and output new percentage.
I have a little problem here though: I don't know how to find the size of a file.
And I'm pretty sure there's a better algorithm out there for this purpose.