hey ive got 2 different classes and each class has its own struct with the same type of data... would i be able to create a function that returns the whole sturct from one class to the other?
ive got something basically like this
class A{
private:
struct student{
int age;
string name;
}student stu;
public:
student returnStu(){ return stu; };
};
class B: public A{
private:
struct parent{
int age;
string name;
}student par;
public:
void setPar(){ par = A::returnStu(); };
B operator=(parent &); // just a guess
};
is it possible to return class A's struct in some function to class B? like..
do i need to overload this? and if so how would i write the overload function?