用C编程以计算文件中的字节数

我现在有一个大项目,是在Linux上用C语言编写的,主要要问的是获取文件并计算字节数(该文件中每个字节的总数),无论它们是字节,二字节或四进制。个字节。结果是这样的:

字节000:23
字节001:12
(...)
字节255:14

Here's the thing: I'm using gengetopt to define each option but I have to define a function to make the count first and I really don't know where to start. If someone could help me I would appreciate. I also can provide more info about the project. Thanks.