struct to bytes

Posted by Dave18 on Stack Overflow See other posts from Stack Overflow or by Dave18
Published on 2010-04-24T23:13:23Z Indexed on 2010/04/24 23:23 UTC
Read the original article Hit count: 262

Filed under:

I'm trying to read encrypted struct data from file using fread(). once i get the decrypted struct bytes, I'd like to it put them back into this struct.

struct data
{
  string s1;
  string s2;
  string s3;
  long l;
};

how would you convert a struct into bytes which can be reconstructed from bytes?

© Stack Overflow or respective owner

Related posts about c++