dirtdart
asked on
Memory optimization
This may seem like an "obvious" or "beginner" question, but I've had no formal training in C++ programming, and I can't find any good information about this particular topic.
I create two classes, ie: A Person class and a Car Class.
Each person will own two cars.
The car class will have a very small number of member variables (2 or 3), but a large number of functions (20 or 30).
There will be a large number of Person classes created at one time during the program, so there will be twice as many car classes created (2 for each person).
My question is: How can I determine the memory footprint (not necessarily exactly, but generally) that is going to be taken up by each car class. If it is going to be heavy because of all the functions, I want to find a different way of going about the whole process.
I create two classes, ie: A Person class and a Car Class.
Each person will own two cars.
The car class will have a very small number of member variables (2 or 3), but a large number of functions (20 or 30).
There will be a large number of Person classes created at one time during the program, so there will be twice as many car classes created (2 for each person).
My question is: How can I determine the memory footprint (not necessarily exactly, but generally) that is going to be taken up by each car class. If it is going to be heavy because of all the functions, I want to find a different way of going about the whole process.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well that was quick and painless! And believe it or not, exactly what I wanted to hear. I was afraid that the methods would dramatically increase the size of the class, and in this case a large class taking up a lot of memory would be totally unacceptable.
Thanks
Thanks
ASKER
Thanks