Feb 19, 2012 at 5:27pm
If I do this:
1 2 3 4 5 6 7 8 9 10
|
class first
{
first(void);
~first(void);
class second
{
second(void);
~second(void);
};
}
|
And then do this:
first::second Somename
Would it use memory for both classes, or just 'second'?
What if I did this:
1 2
|
first::second Somename
first::second Somename2
|
Would it use memory for 'first' twice?
Last edited on Feb 19, 2012 at 5:35pm
Feb 19, 2012 at 5:41pm
first and first::second is two different classes and does not affect each others size.
Feb 19, 2012 at 5:43pm
Ok, thank you. I wasn't sure because 'second' is part of 'first'.
Feb 19, 2012 at 8:59pm
You declare second in the scope of first, however, you are not using composition of second in first which is why you only use memory for second.