#include <stdio.h> int main(int argc, char* argv[]) { FILE * fp = fopen("data", "r"); char buffer[2] = {0x03, 0x00}; short * i = buffer; fread(buffer, 1, 2, fp); *i &= 0x00ff; printf("%04hx\n", *i); fclose(fp); return 0; }