|
-
April 28th, 1999, 11:40 AM
#1
References versus pointers
Hi,
If I want to pass the address of something to a function, why would it ever be better to use a reference instead of a pointer ? I'm aware of two possible reasons :
1 : I know that the called function is more legible if I use a reference. (I don't have to dereference a reference :-))
2 : If I decide that the called function requires not the address of the "something" but the value of the "something", I can make the change simply in the the function prototype.
What other advantages are there ?
Regards,
Brendan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|