diff in nested class and composition
CASE 1
1 2 3 4 5 6 7 8
|
class outer{
public:
class inner{
public:
inner();
~inner();
};
};
|
CASE 2
1 2 3 4 5 6 7 8 9 10
|
class inner{
public:
inner();
~inner();
};
class outer{
public:
inner obj;
};
|
When should prefer nested class and when to composition??
Last edited on
Topic archived. No new replies allowed.