I got my program to work but I want to add an if statement where if the file is empty to print out a message to tell the user that its empty. Here is a small part of my code.
it should be a long and not an int. This also has a potential of overflow. You can only get the size of files up to 2GB. This will not work for larger files. You will need to use the function fstat