Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Why would you ever... Return a Pointer or reference..

$
0
0
Ok, so I understand pointers and references, ive used them before plenty of times. Thing is that I just doin't understand the concept of returning a pointer or a reference..

Are you trying to return a dynamic allocated object??? To an awaiting pointer that points to allocated stack memory... Thats the only reason I would think is necessary to return a pointer or reference.

But can anybody explain to me other reasons for returning a pointer or reference.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>