1. When passing objects between each other is it preffered to use references if not what then?
5. When allocating resources should you always do it inside of a class?
To answer your first question: yes, the preferred way of passing objects is
pass by reference
In your fifth question you make an assumption which is wrong (unless you implement a destructor for your class as well), if you use dynamic memory allocation inside a class, and you don't make use of a
destructor, the memory won't be freed
And regarding question 4, what SDK are you talking about? It's common in class libraries that there are rules to name for example variables or functions, i.e. to make it easier for the programmer to go through/read the code
Could you be more specific in your second question?
Last edited by tux4life; May 27th, 2009 at 3:05 pm.
Reputation Points: 2125
Solved Threads: 243
Postaholic
Offline 2,105 posts
since Feb 2009