Sure, there is code for it. It's not a subject for n00bies though. Pardon my bluntness but futzing around won't do much. Using Borland there are a lot of tutorials for opening PCX files, which are the simplest kind of files, and I'm sure there are libraries and tutorials for gif and jpg files.
I'll point you to a PCX tutorial. Be patient if the tutorial is in Pascal, the original was, then it was rewritten, more than ten years ago. Still works though. This computer is about two years old and it's worked on that:
http://www.hornet.org/code/tutors/denthor/
Now for something different, C/C++ uses libraries. By default your program links to the libc library. It won't run at all otherwise. There is a game playing (read graphics) library called Allegro it is worth commenting on:
http://alleg.sourceforge.net/
You compile it with the compiler you will use it with. There is a specific Borland/Turbo C++ makefile which you will use (follow the README instructions) and it should simplify graphics programming immensely while you figure out what you are doing. I will admit, I haven't used it in years, but that's also true of tcc (the Borland command line compiler).