I have two classes A and B.
class A has it's member functions as public and its data types as private. Class B also has it member functions as public and data types as private. BUT (here's my problem) in class B one of the datatypes is A example....
// This is class B
private:
A a;
char* string;
static int count;
i have to access class A WITHOUT using inheritance, only using class composition. When i compile i get the error "var1" cannot access private member of class A. If i cant use inheritance how do i access its members. Secondly, in class B i have to use the default constructor to initialize the the data types from class A.
example....
class A has....
int a, b,c
i've done it like this...but its wrong
B(a.a,a.b,a.c) //class B constructor intializing data types from class A
anyone has any ideas?
Hopefully this gives u an understanding....