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

August 2025

S M T W T F S
     1 2
3 4 56789
1011 1213141516
171819202122 23
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 27 August 2025 08:26
Powered by Dreamwidth Studios