Skip to content

Instantly share code, notes, and snippets.

@mvallebr
Last active August 29, 2015 14:25
Show Gist options
  • Save mvallebr/9af9a59bec3e13f6a2f6 to your computer and use it in GitHub Desktop.
Save mvallebr/9af9a59bec3e13f6a2f6 to your computer and use it in GitHub Desktop.
c++ instanciation problem
class Classe1 {
Classe1(int a);
};
class Classe2 {
Classe1 c1;
void do_something(Classe1 &arg) {
c1 = arg;
// do other something
}
};
class Classe3 {
Classe2 c2;
void op3(int a) {
if (a > 15) {
// constroi instancia de classe 1 de alguma forma
Classe1 *c1 = /* ... */ ;
c2.do_something(*c1);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment