
-----------------------------------
Homer_simpson
Tue Jul 08, 2003 11:04 pm

having a class as a member of one structure...
-----------------------------------
let's say i have created some class and named it MyClass;
and now i'm creating a structure like this

typedef struct _MONEY {					
double x,y,z;
MyClass Class_1;				
} MONEY;

Is that possible?

-----------------------------------
UBC_Wiskatos
Tue Jul 08, 2003 11:15 pm

Re: having a class as a member of one structure...
-----------------------------------
let's say i have created some class and named it MyClass;
and now i'm creating a structure like this

typedef struct _MONEY {					
double x,y,z;
MyClass Class_1;				
} MONEY;

Is that possible?

Most definitely yes, just be sure to include the header of the other class, if you follow that organization style.

-----------------------------------
Homer_simpson
Wed Jul 09, 2003 12:07 am


-----------------------------------
hmmm... then there must be something wrong with my coding... since the structure wont take it as a member :?

-----------------------------------
rizzix
Wed Jul 09, 2003 2:57 am


-----------------------------------
try MyClass *myclassobj;
yea use a pointer of type MyClass

-----------------------------------
Homer_simpson
Wed Jul 09, 2003 1:28 pm


-----------------------------------
nah... didn't need pointer i got it working now...
