C Programming - C Preprocessor - Discussion

2. 

Would the following typedef work?
typedef #include l;

[A]. Yes
[B]. No

Answer: Option B

Explanation:

Because typedef goes to work after preprocessing.

Mohamed A said: (May 5, 2014)  
Why can any one explain ?

typedef is written in preprocessor space and should be treated as #define for example ?

Ramya said: (Oct 27, 2015)  
Please clear explanation.

Ridha said: (Aug 5, 2016)  
typedef struct name
{
int roll_no;
}

Now you can treat the name as a datatype.
name n1;
But it's done after the preprocessing and #include is replaced by exact files during preprocessing hence wrong.

Deepa.L said: (Oct 20, 2018)  
Please explain more about it with the example code.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.