Possible Duplicate:
C++ - when should I use a pointer member in a class
I've worked with c++ for years but I still have questions I havent answered.. I am defining a c++ class but I have some doubts about this
question 1: should I store investment by using pointer or no?
Investment* investment;
// or
Investment investment;
question 2: why?
question 3: in case I use Investment investment;
should I return a reference this way Investment & getInvestment();
?
I know that both ways my code works but I would like to know the efficient way to do this..
the code follows:
class Urgency
{
private:
Investment* investment;
public:
Urgency(Investment* investment);
~Urgency(void);
Investment* getInvestment();
};