Estimated time: 25 minutes
Given a binary file containing some (possibly none) positive integers (
int) that were stored in a file, write a code that computes the sum of all of these integers. The function returns the sum when there are no errors. In case of errors, it returns.
You can only use
fstat(2) is mandatory to know the size of the file and thus with a simple formula, the number of integers that are stored in it (find it !).