part of the code, reading an image file into memory -------------------------------------------------------- unsigned char Picture[Size][Size][BytesPerPixel]; if (!(file=fopen(argv[1],"rb"))) { cout << "Cannot open picture: " << argv[1] <<endl; exit(1); } fread(Picture, sizeof(unsigned char), Size*Size*BytesPerPixel, file); fclose(file); --------------------------------------------------------- when i tryied to get the value of the 1st element in Picture, i put cout << Picture[0][0][0] << endl; after fread(.... before flose(file); , it turned out to be nothing printed on my WinXP command prompt. However, the image file was stored successfully because i got the desired image after end of execution(store pic and spit out the exact same pic). the problem is i couldn't get the values stored in Picture. any ideas ? thx. ...racking my brain....