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
971 5b5cc7dde4d2b419777515df
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 Answer
- Workspace
- Discuss