From pointers and references; which one is more efficient in terms of memory usage?”
Hello,
From pointers and references; which one is more efficient in terms of memory usage?
Re: From pointers and references; which one is more efficient in terms of memory usag
There's no significant difference, especially once the optimizer gets involved.
Re: From pointers and references; which one is more efficient in terms of memory usag
Technically references are implicit pointers. There should not be differences.
Re: From pointers and references; which one is more efficient in terms of memory usag
thanks but what is difference in terms of memory? Detail please.................?
Re: From pointers and references; which one is more efficient in terms of memory usag
How a compiler chooses to implement references is not defined by the standard, as far as I know. Thus there's no way to answer your question.
For all intents and purposes, you should consider them equivalent in terms of memory usage.
Re: From pointers and references; which one is more efficient in terms of memory usag
Quote:
Originally Posted by
itguy310
thanks but what is difference in terms of memory? Detail please.................?
As Lindley pointed out, there is no standard way that references are implemented. If you have the C++ specification, the only thing that is mentioned about references is how they are supposed to behave, not how they're implemented.
Regards,
Paul McKenzie
Re: From pointers and references; which one is more efficient in terms of memory usag
There are no null references.