On the other hand, pointer input arguments can act as a tri-state (in digital design-speak), so they can have benefits too. Example:
void Widget::setColor (COLORREF *fg, COLORREF *bg){ if (fg) m_clrFg = *fg; if (bg) m_clrBg = *bg;}
Obviously, if I want to just set the foreground or just the background and leave the other the way it was, I can do so with the above code. You can't do that with references.
I like to use pointers where I'd like the option of not specifying a parameter, and references when the parameter must exist. However, I have heard that you should never use references in the parameter list because it confuses those who haven't quite left their C roots behind. I don't agree, but I have heard it; if you're working in a team environment, you might consider the style of your coworkers before deciding to go reference-happy.
Edited by - Stoffel on June 29, 2001 12:11:59 PM