Hi. I want to learn about how classes are allocated in memory. Is there an instance of each function for every instance of the class? That would seem pretty wasteful to me. For instance:
//if class 'ThisClass' had a function like this..
ThisClass::ThisFunc()
{
int ANumber;
}
//And then i had several instances of it...
ThisClass MyClass[10];
Is there memory allocated for 'ANumber' 10 times? How does this all work? How are functions stored in memory? If i saved my class to a file what would happen? It would just be the pointers to the functions location in memory at the time it was saved that were stored right (as well as variables in th class)?
fwrite(&MyClass[0], ...
???
Thank you for your help.