I have Class A as a base class , and Class B , C derived classes from A and there's class D who have a data member (pointer to Array) of type A (Composition)
class D{
A **a;
int size;
.......
a = new A*[size];
......
};
and i have Print method , in its body i have to specific element (if it from class B or C ) with a given ID(both B and C have a data member ID ) there should be 2 options in print function .. printing elements for class B , or printing elements for class C ? how can i specific the elements ?
Do want to be able to print everything, and indicate what type is being printed,
Or you want to be able to select just one type and print just that type?
think u @tipaye !
i want 3 options :
1 printing elements from class B .
2 printing elements from class C .
3 printing All elements from class B and class C .
@ResidentBiscuit !
i did it before !!
but what i want is in PRINT() of Class D, how can i specific the elements if it from class B (so i call print from class B) , or class C ?