InidBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming Java Programming
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Group Disucssion HR Interview Questions Technical Interview Questions Body Language
"Act well your part; there all honor lies."
- Alexander Pope

C Programming - C Preprocessor - Discussion

@ : Home > C Programming > C Preprocessor > General Questions - Discussion
1. 

What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile?

#include<stdio.h>
#define SWAP(a, b, c)(c t; t=a, a=b, b=t)
int main()
{
    int x=10, y=20;
    SWAP(x, y, int);
    printf("%d %d\n", x, y);
    return 0;
}

[A]. It compiles
[B]. Compiles with an warning
[C].
Not compile
[D]. Compiles and print nothing

Answer: Option C

Explanation:

The code won't compile since declaration of t cannot occur within parenthesis.


Padhu said: (Tue, Jul 27, 2010 09:46:02 PM)    
 
Which parentheis that cannot occur

Write your comments here:


© 2008-2010 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy