how to return error through a function whose return type is int

I have a function that reads through a file and returns sum of the numbers in the file. I am checking whether the file exists or not. if it doesn't exist, I will return 1. but my problem is the ret...