As long as you are still in console C++ classes and you can't even solve an easy homework yourself, I think you'll better stay off this topic...

C++ does not load, save or print images. That is done by you or a library (usually a library, cause we're not reinventing the wheel). How you do that depends on the image format. You read bmps differently than you would read gifs or jpegs. You load all of them byte by byte and interpret what you get (sort of).