A
ArbolOne
class a_class{
public:
int id;
Glib::ustring fname;
};
std::vector<a_class>& my_class::my_method(){
a_class obj;
obj.id = 1;
obj.fname = "Me";
std::vector<a_class> v;
v.push_back(obj);
return v;
}
void a_method(){
std::vector<a_class> v;
my_class obj;
v = obj.my_method();
}
The program above gives me an class a_class{
public:
int id;
Glib::ustring fname;
};
std::vector<a_class>& my_class::my_method(){
a_class obj;
obj.id = 1;
obj.fname = "Me";
std::vector<a_class> v;
v.push_back(obj);
return v;
}
void a_method(){
std::vector<a_class> v;
my_class obj;
v = obj.my_method();
}
The program above gives me an RTE(Run Time Error), what am I doing wrong?what am I doing wrong?
public:
int id;
Glib::ustring fname;
};
std::vector<a_class>& my_class::my_method(){
a_class obj;
obj.id = 1;
obj.fname = "Me";
std::vector<a_class> v;
v.push_back(obj);
return v;
}
void a_method(){
std::vector<a_class> v;
my_class obj;
v = obj.my_method();
}
The program above gives me an class a_class{
public:
int id;
Glib::ustring fname;
};
std::vector<a_class>& my_class::my_method(){
a_class obj;
obj.id = 1;
obj.fname = "Me";
std::vector<a_class> v;
v.push_back(obj);
return v;
}
void a_method(){
std::vector<a_class> v;
my_class obj;
v = obj.my_method();
}
The program above gives me an RTE(Run Time Error), what am I doing wrong?what am I doing wrong?