Pointers have their usages. One of these, is passing relatively large objects to functions.
Consider, for instance
struct Point
{
double x,y,z;
};
double distance_byval(Point pa, Point pb);
double distance_byref(Point * ppa, Point * ppb);
At every call,
2*sizeof(Point)
(namely
48
) bytes are copied form the caller code to the
distance_byval
function.
On the other hand just the two pointers (that is
16
bytes on a
64-bit
machine) are copied from the caller to the
distance_byref
function.
Note a somehow nicer formulation of the
distance_byref
would be
double distance_byref(Point & pa, Point & pb);
Anyway that wouldn't change my point (pardon the pun).
[update]
Fixed a bug thanks to
KasternK.
[/update]