How to map the file of jpg or bmp directly on the quads?

I have tried to convert the file of jpg or bmp to the two dimensional array. But I do not know how to convert the units of the array whose type might be “double” to the “GLubyte” type

Hi!
Why not to look at the redbook? http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/
Chapter 9. Texture Mapping, Example 9-1 : Texture-Mapped Checkerboard: checker.c