total_bytes_read and bytes_read I need to declare as integers and my program should work?
what do I think of it? Your solution seems simple and I like keeping it simple. Let me just try it out to see if it works.
The solution provided on stack-overflow is extremely confusing to me and doesn't work.