Waitrud Weber’s blog

things and reminders for memories

CodeAnalyzer: html: Big-endian and filesystem.

In filesystem, small number is more first writable on the memories, which means on the memories they are big-endian.

 

1 - - -
 

main.cpp  Fri Apr 15 16:17:34 2022

... 

77 :int main ( int argc, char** argv ) {
 78 :    char* char_string;
 79 :    char four_string[4];
 80 :    float b;
 81 :    float *pb;
 82 :    int a;
 83 :    FILE *wfp;
 84 :    HTMLTAG htag;
 85 :    HTMLTAG *phtag;
 86 :
 87 :    b= 187.938267f;
 88 :// x    four_string = (char [4])b;
 89 :    char_string = (char*) four_string;
 90 :// x    char_string = (char*) b;
 91 :// x    htag=(HTMLTAG)b;
 92 :// *    phtag=(HTMLTAG*)b;
 93 :
 94 :    phtag = (HTMLTAG*)&b;
 95 :// x    four_string = (const char*)&b;
 96 :    char_string = (char*)&b;
 97 :
 98 :    a = 0xFE;
 99 :    wfp = fopen(".\\001-20220407-002.fb", "wb");
100 :    fwrite( char_string, sizeof(char), array_count(char_string), wfp);
101 :    fwrite( &b, sizeof(float), 1, wfp);
102 :    fwrite( &a, sizeof(int), 1, wfp);
103 :
104 :    fclose(wfp);
105 :
106 :    return 0;
107 :}

   
   ADDRESS   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F   0123456789ABCDEF 
------------------------------------------------------------------------------
 00000000  32 F0 3B 43 FE 32 F0 3B 43 FE 00 00 00            2.;C.2.;C....