Code:
void print (int* ip) {
cout<<*ip<<endl;
}
int main ()
{
int i;
print (&i);
}
I think the compiler will think int* ip=&i in this case.
Code:
void print (int* i) {
cout<<*i<<endl;
}
int main ()
{
int i;
print (&i);
}
I think the compiler will think
int* i=&i in this case.
Then my trouble comes up:
We know in c++, the expression
int* i=&i is evil. Howeve, The code still make sense, why?
thank you.