Basic functions to save and load .ppm image files in C++