Hi, everyone!


Sometimes we use pointer as the parameter type and sometimes
we use reference as the parameter type.

I think using reference is better than using object directly.
Since it can save memory and operation (assignment operator).
But what about pointer V.S. reference? I want to know in which
case should I use pointer and in which case should I use reference.

Here are two samples,


Using reference,

--------
ostream& operator << (ostream&, ObjectType);
--------

Using pointer
--------
MemPoolAddSize (char*, size_t)
--------


I want to know your suggestions about pointer v.s. reference.
What is the general consideration about when using pointer and
when using reference?


Thanks in advance,
George