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

October 2025

S M T W T F S
   123 4
5 6 78910 11
121314151617 18
19202122 2324 25
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 26 October 2025 23:17
Powered by Dreamwidth Studios