mickey
7th November 2007, 20:00
create (vector<ClassA>* vec) {
cout << " vec " << vec << endl;
cout << " &vec " << &vec << endl;
cout << " &vec[0] " << &vec[0] << endl;
cout << " (&vec)[0] " << (&vec)[0] << endl;
Hi, I cant understand why 1 and 3 print the same address: 1 should be print the content of vec (that's the address to which vec point ie the address of vector that create take; 2 sould be the address of variabile vec; 3 for me shouldn't exists: [ and ] have precedence on & ???
cout << " vec " << vec << endl;
cout << " &vec " << &vec << endl;
cout << " &vec[0] " << &vec[0] << endl;
cout << " (&vec)[0] " << (&vec)[0] << endl;
Hi, I cant understand why 1 and 3 print the same address: 1 should be print the content of vec (that's the address to which vec point ie the address of vector that create take; 2 sould be the address of variabile vec; 3 for me shouldn't exists: [ and ] have precedence on & ???