Functions

Started by
0 comments, last by _elmo 21 years, 3 months ago
I''ve got a question about function declaration (and implementation). Sometimes I''ll see a function declaration such as: void function(vector* v); and sometimes I''ll see a function declaration such as: void function(vector& v); What is the difference between the two declarations... And which should you use???
*elmo*
Advertisement
void function(vector* v); - this is a pointer
void function(vector& v); - this is a Reference

A reference is like a dereferenced pointer, you should use the reference if you want to point directly to the value stored in that part of the memory and use pointers if you want to see the memory address.

thanks
jack



[edited by - iamwithstupid on January 30, 2003 12:08:24 PM]

This topic is closed to new replies.

Advertisement