We can't just give you code for this: it will depend on what image type you are trying to read:
.JPG internal format is totally different from .BMP for example.
C does not have the high-level routines to read an image file - you have to read the file format and process it yourself.
Reading the file is easy:
input = fopen("myimage.bmp", "rb");
Reads a file a byte at a time.
You will need to Google for the file format, and process it accordingly.