Last active
August 29, 2015 14:25
-
-
Save mvallebr/9af9a59bec3e13f6a2f6 to your computer and use it in GitHub Desktop.
c++ instanciation problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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