DEV Community

loading...

Discussion on: Parameter passing in C++

Collapse
jeikabu profile image
jeikabu • Edited

& and * have the important difference that the latter can easily be null. It's helpful to keep them distinct, and some might say "use a reference when you can, a pointer when you must". There's also const T * const that's worth mentioning.

There's also && (C++11 rvalue reference) and ** (pointer to a pointer), but maybe you're saving those for the next article.