ireland
January 31st, 2005, 10:49 AM
what is the usage of references?
why not use const pointers ?
I have seen very little use of references and have never used one
Heres an example of something like I have seen, why not just use pointers and pass them to the function instead.
....
Foo foobar = ....;
..
function ( foobar);
...
Bar (&Foo)
{
//do something
}
What happens in memory with this reference , is a copy of the orignals objects contents made ?
why not use const pointers ?
I have seen very little use of references and have never used one
Heres an example of something like I have seen, why not just use pointers and pass them to the function instead.
....
Foo foobar = ....;
..
function ( foobar);
...
Bar (&Foo)
{
//do something
}
What happens in memory with this reference , is a copy of the orignals objects contents made ?