Class Memory Usage

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
first and first::second is two different classes and does not affect each others size.
Ok, thank you. I wasn't sure because 'second' is part of 'first'.
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.
Topic archived. No new replies allowed.