M
manishster
I keep getting the following in my output file , regardless of whether
I convert endian-ness or not [ currently commented out in the code
below ]. How do i get "01 02 03 04" ....
Mahamannu
output : 04 03 02 01 b0 00 00
Code :
//nHeight = swap_script(nHeight);
//nWidth = swap_script(nWidth);
nHeight = 0x01020304 ;
// nHeight = (nHeight >> 24) | ((nHeight << 8) & 0x00FF0000) |
((nHeight >> 8) & 0x0000FF00) | (nHeight << 24) ;
printf("and the height value after changing endian-ess is ");
printf("0x%08x\n",nHeight) ;
fwrite(&nHeight, sizeof(unsigned int), 1, fOut);
fwrite(&nWidth, sizeof(unsigned int), 1, fOut);
I convert endian-ness or not [ currently commented out in the code
below ]. How do i get "01 02 03 04" ....
Mahamannu
output : 04 03 02 01 b0 00 00
Code :
//nHeight = swap_script(nHeight);
//nWidth = swap_script(nWidth);
nHeight = 0x01020304 ;
// nHeight = (nHeight >> 24) | ((nHeight << 8) & 0x00FF0000) |
((nHeight >> 8) & 0x0000FF00) | (nHeight << 24) ;
printf("and the height value after changing endian-ess is ");
printf("0x%08x\n",nHeight) ;
fwrite(&nHeight, sizeof(unsigned int), 1, fOut);
fwrite(&nWidth, sizeof(unsigned int), 1, fOut);