Better error reporting when failed to open file
I'm OCD about explicit return 0
Updated code to use modern safe idiomatic C++.

Signed-off-by: retep998 <retep998@verizon.net>
Merge pull request #6 from retep998/master

Heyo