variables in instances of a class
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..
//And then i had several instances of it...
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)?
Thank you for your help. :)