krishna.kishore.0987@gmail.com wrote:
> Why are always object pointers used? (i.e., ObjectType *objPointer)
> what are the advantages of using object pointers Vs objects
> (ObjectType obj)
Polymorhpism and slicing.
> one advantage I see is passing them across methods, but is this purely
> presentation issue (use 'objPointer' rather than '&obj') or are there
> some performance affects?
Now you're talking about references instead of copied objects. The
advantage is that a reference parameter always refers to a valid object
(modulo UB in the caller, of course).