Advertisement

WinSuck, can only send a char* ?

Started by September 12, 2003 01:03 PM
51 comments, last by Wickeeed 21 years, 4 months ago
To RonHiler:

I''d changed second structure, adding inheritance etc...
This is results:

sizeof(struct1)==2
sizeof(struct2)==8 // !!!

0x0012FED4 01 02 // struct1
0x0012FEC4 c8 40 42 00 03 04 // struct2

Before member data in struct2, i see 4 bytes of ''garbage''...
So, you been right after all
Anyway, i didn''t like the idea of saving(sending) entire struct(class) like that from the start I just wanted to test your words about adding this-variable and other stuff and i''m happy now.

To all:
BTW: Reading this thread was lot of fun! Thanks a lot, guys!!!

//==============================
struct struct1
{
unsigned char m1;
unsigned char m2;
};

//==============================
struct base_struct2
{
protected:
unsigned char n1;
unsigned char n2;
base_struct2() {n1=3; n2=4;}
};

struct struct2: public base_struct2
{
protected:
virtual void Clean() {n1=0; n2=0;}
public:
struct2(): base_struct2() {}
virtual ~struct2() {Clean();}
};

Not registered: Fei
Why is a total noob trying to write network code?

You need to read up on pointers.
Advertisement
Cause thats the way you learn. =)

-=[ Megahertz ]=-
-=[Megahertz]=-

This topic is closed to new replies.

Advertisement