mercredi 24 février 2016

C++: Is it normal to pass array reference to function

Arrays can be passed as pointer to a function or even as reference. Passing it as reference gives an alias on which sizeof and count operators will also work. This makes pass by reference look superior.

However, pass by pointer seems to be the norm in books. Why? Is there something I particularly need to know about pass by reference for arrays?

Aucun commentaire:

Enregistrer un commentaire