if i was to output like this
PHP Code:
class cRect{
public:
cRect(int x, int y, int w, int h);
int x,y,w,h;
};
class sRect{ //or just struct sRect
public:
int x,y,w,h;
};
....
cRect cr;
sRect sr;
....
ofstream binout("file.dat",ios::out|ios::binary);
binout.write( (char*)&sRect, sizeof(sRect));
binout.write( (char*)&cRect, sizeof(cRect));
....
would these both do the same thing?? basically what i'm asking is if having methods affects the size of a class for these purposes.
if this worked couldn't i use sRect and cRect interchangably in I/O?
thanks in advance