![]() |
|
#1
|
|||
|
|||
vectors of referencesHi! I know you can have vectors of values and vectors of pointers, but can you have vectors of references??
Thanks, Michelle |
|
#2
|
||||
|
||||
|
Quote:
No, a reference is just an alias (another name) for your variable. You need to initialise it from the start, and you can't change it to "point" (this is NOT the right word CPP / C++ / C Code:
In this sample code, ri_var is just another name for i_var in the current scope. However, this is illegal: CPP / C++ / C Code:
You can't name i_var1 -> ari_var[0], that would be cumbersome, right? Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
Recent GIDBlog
Flickr uploads of IA pictures by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with vectors | iamsodumb | C++ Forum | 1 | 18-Mar-2005 15:50 |
| newbie needs help with vectors | Quesius | C++ Forum | 0 | 30-Nov-2004 23:35 |
| C++ Vectors | Katie | C++ Forum | 5 | 17-May-2004 23:36 |
| Declaring a vector of vectors? | Lethal411 | C++ Forum | 2 | 20-Mar-2004 09:02 |
| help with c++ vectors | beebop | C++ Forum | 1 | 12-Mar-2004 06:03 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The