|
|
Initial addres for element 0 is 0x18d7010 Pointer vector 0 is 0x18d7010 and points to 0 Initial addres for element 1 is 0x18d7054 Pointer vector 1 is 0x18d7054 and points to 1 Initial addres for element 2 is 0x18d7038 Pointer vector 2 is 0x18d7038 and points to 2 Initial addres for element 3 is 0x18d703c Pointer vector 3 is 0x18d703c and points to 3 Initial addres for element 4 is 0x18d70b0 Pointer vector 4 is 0x18d70b0 and points to 4 Pointer vector 0 is 0x18d7010 and points to 26046528 Pointer vector 1 is 0x18d7054 and points to 0 Pointer vector 2 is 0x18d7038 and points to 2 Pointer vector 3 is 0x18d703c and points to 3 Pointer vector 4 is 0x18d70b0 and points to 4 |
|
|
|
|
My pointers seem to be pointing at the right addresses, but when I try to get the value they are pointing to a second time, the first elements of the vector are all garbled. |
the_vector.push_back(k);
|
|
|
|
|
|
Initial address for element 0 is 0x138d220 Pointer vector 0 is 0x138d220 and points to 0 Initial address for element 1 is 0x138d1c4 Pointer vector 1 is 0x138d1c4 and points to 1 Initial address for element 2 is 0x138d1e8 Pointer vector 2 is 0x138d1e8 and points to 2 Initial address for element 3 is 0x138d1ec Pointer vector 3 is 0x138d1ec and points to 3 Initial address for element 4 is 0x138cdc0 Pointer vector 4 is 0x138cdc0 and points to 4 Vector 0 is 0and its address is 0x138cdb0 Pointer vector 0 is 0x138d220 and points to 20500912 Vector 1 is 1and its address is 0x138cdb4 Pointer vector 1 is 0x138d1c4 and points to 0 Vector 2 is 2and its address is 0x138cdb8 Pointer vector 2 is 0x138d1e8 and points to 2 Vector 3 is 3and its address is 0x138cdbc Pointer vector 3 is 0x138d1ec and points to 3 Vector 4 is 4and its address is 0x138cdc0 Pointer vector 4 is 0x138cdc0 and points to 4 |