int i=24;
int* poin;
*point=i;
cout<<*poin;
cout<<poin;
cout<<&i;
why pion and &i does not show the same results as poin contain the address of i and &i means adress of i
This is a discussion on pointers within the C++ Programming forums, part of the General Programming Boards category; int i=24; int* poin; *point=i; cout<<*poin; cout<<poin; cout<<&i; why pion and &i does not show the same results as poin ...
int i=24;
int* poin;
*point=i;
cout<<*poin;
cout<<poin;
cout<<&i;
why pion and &i does not show the same results as poin contain the address of i and &i means adress of i
Why do you think poin contains the address of i? If you had done poin = &i, then yes. Otherwise, no.
int *poin defines a pointer, but it doesn't point to anywhere in particular. So *poin = i puts the value of i in the memory address pointed to by poin (wherever it is).
I'm quite surprised you don't get a crash.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
you have your referencing/dereferencing operators backwards.