#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { unsigned int tmp; FILE *fp; if( (fp = fopen("data.bin", "rb")) == NULL ){ fprintf(stderr, "file open error¥n"); exit(1); } while( fread( &tmp, sizeof(int), 1, fp ) != 0 ){ printf("tmp=%x¥n", tmp); printf("R=%x¥n", (tmp>>8 )&0xFF ); printf("G=%x¥n", (tmp>>16 )&0xFF ); printf("B=%x¥n", (tmp>>24 )&0xFF ); } fclose( fp ); return 0; }