I'm playing around with pointers trying to figure out how
the operator & works. My impression was that it can be
used to create a pointer to a thingy. So, i created the
following code and ran it.
int bops = 17;
void* gPtr_1 = & bops;
void* gPtr_2 = & bops;
std::cout << gPtr_1 << std::endl;
std::cout << gPtr_2 << std::endl;
I was expecting to see two different addresses but that
didn't happen. Why?
A follow up question - how can i create two _DIFFERENT_
pointers to the bops-variable?
--
Vänligen Kerstin Viltersten
(The Cool Giraffe)
the operator & works. My impression was that it can be
used to create a pointer to a thingy. So, i created the
following code and ran it.
int bops = 17;
void* gPtr_1 = & bops;
void* gPtr_2 = & bops;
std::cout << gPtr_1 << std::endl;
std::cout << gPtr_2 << std::endl;
I was expecting to see two different addresses but that
didn't happen. Why?
A follow up question - how can i create two _DIFFERENT_
pointers to the bops-variable?
--
Vänligen Kerstin Viltersten
(The Cool Giraffe)
Comment