consider the following code
afunction(int *x)
{
x=new int;
*x=12;
}
int main()
{
int v=10;
afunction(&v);
cout<<v;
}
i expected 12
as the output but its wrong and correct one is 10
. But i don't know how this is done internally ?
i was wondering if somebody could explain about it ?
thanks.