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..
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Hey... why you gotta pull the moderator card on me, Salem? I am sorry