Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

_elmo

Functions

This topic is 5592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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???

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!