Join ExamsbookAnswer :
Indicate what would the SWAP macro be expanded to on preprocessing. Would the code compile?
#define SWAP (a, b, c ) (c t; t = a, a = b, b = t; )
main()
{
int x = 10, y = 20;
SWAP (x, y, int );
printf ( " %d%d ", x, y);
}5
Q: Indicate what would the SWAP macro be expanded to on preprocessing. Would the code compile? #define SWAP (a, b, c ) (c t; t = a, a = b, b = t; ) main() { int x = 10, y = 20; SWAP (x, y, int ); printf ( " %d%d ", x, y); }
- Show AnswerHide Answer
- Workspace
Answer :
Explanation :
( int t ; t = a, a = b, b = t ;); This code won't compile since declaration of t cannot occur within parentheses.