I was trying to decode bmp file.
#include<stdio. h>
int main ()
{
FILE *fp;
char a[2];
fp=fopen("black buck.bmp","r");
fread(a,sizeof( short int),1,fp);
fclose(fp);
a[2]='\0';
printf("value %x\n",a);
return 0;
}
but the value it shows is coming different. The value is 4d42 for BM. but it is computing 22cd32.
THanks in advance
#include<stdio. h>
int main ()
{
FILE *fp;
char a[2];
fp=fopen("black buck.bmp","r");
fread(a,sizeof( short int),1,fp);
fclose(fp);
a[2]='\0';
printf("value %x\n",a);
return 0;
}
but the value it shows is coming different. The value is 4d42 for BM. but it is computing 22cd32.
THanks in advance
Comment