6 February 2016

gxachaturov: (Default)
Incorrect, Karl:

    void myclass::Deserialize(long &count, FILE *pfin){

              int sz = sizeof(*this), i;
              char *pf = (char*)this;

              for (i = 0; i < sz; pf++, i++, count++)
                       *pf = fgetc(pfin);  
    }

Correct:

     void myclass::Deserialize(long &count, FILE *pfin){

            int sz = sizeof(*this), i, auxcount = count;
            char *pf = (char*)this;

            for (i = 0; i < sz; pf++, i++, auxcount++)  
                      *pf = fgetc(pfin);
  
            count = auxcount;
}

Profile

gxachaturov: (Default)
gxachaturov

December 2025

S M T W T F S
 12345 6
789 101112 13
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 19 December 2025 00:25
Powered by Dreamwidth Studios