Hi,
I'm currently reading a c++ book, and I'm a bit confused about pointers.
Here is some of the code which I'm confused about:
cout << "Addresses of pointers..." << endl;
cout << "aPtr: " << &aPtr << endl;
cout << "bPtr: " << &bPtr << endl << endl;
cout << "Addresses of pointers..." << endl;
cout << "aPtr: " << &aPtr << endl;
cout << "bPtr: " << &bPtr << endl << endl;
To copy to clipboard, switch view to plain text mode
Now, all this does is show me the addresses of 2 pointers, aPtr and bPtr.
But why do I need the '&'? I tried taking the '&' off and it still works, but the book has the '&' prefix in.
Thanks for your help.
Bookmarks