![]() |
|
#1
|
|||
|
|||
Functions: Passing pointers vs by referenceHey All,
I was wondering something. Fundamentally, is there anything different between passing a pointer and passing something by reference? For example: CPP / C++ / C Code:
I know, at least in this case, they are functionally the same. I was wondering what about behind the scenes? Does C++ basically just do a bunch of mojo that when compiled, references are properly replaced with their pointer equivalents? I was also wondering what happens when you return something by reference? The easiest example is an overload for the << operator to an ostream. CPP / C++ / C Code:
When a reference is returned, is that an address ala a pointer? Thanks. |
|||
Recent GIDBlog
Master?s Degree by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 10:13 |
| gnu.linkonce undefined reference | newbie06 | CPP / C++ Forum | 4 | 13-Mar-2007 09:53 |
| Passing an object as a reference. What is wrong? | _Y_ | Java Forum | 1 | 29-Aug-2006 11:58 |
| Difficulty Passing Structure Data Elements Between Functions | jdbrine | CPP / C++ Forum | 9 | 21-May-2006 12:03 |
| [Tutorial] Pointers in C (Part II) | Stack Overflow | C Programming Language | 0 | 27-Apr-2005 17:36 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The