Saturday, 7 September 2013

Explain the following syntax, i am not able to comprehend this

Explain the following syntax, i am not able to comprehend this

int a=4;
int *p=&a;
This syntax is right but when we write like this
int a;
int *p;
*p=&a;
The third line is an error and i know that but, why is it possible to do
so in first code
int *p=&a;
We even do this when we pass the value by reference to functions ...
Thanks for the reply

No comments:

Post a Comment