Code:int i, *p, *q;
// is this legal or illegal? Which one is legal and what is not?
p = i;
* p = &i;
&p = q;
p = &q;
p = *&q;
p =q;
p = *q;
*p = q;
*p = *q;
//Just wondering which of these are legal in all situations..
Printable View
Code:int i, *p, *q;
// is this legal or illegal? Which one is legal and what is not?
p = i;
* p = &i;
&p = q;
p = &q;
p = *&q;
p =q;
p = *q;
*p = q;
*p = *q;
//Just wondering which of these are legal in all situations..
Ok... that was lame.
Code:p = i;
* p = &i;
&p = q;
p = &q;
p = *&q;
p =q;
p = *q;
*p = q;
*p = *q;
Create a program, see which ones generate error messages, hence the answer.
Hey... why you gotta pull the moderator card on me, Salem? I am sorry :(