Question 2.
Explain preprocessor directives in C.
int x = VALUE;
1)Preprocessor Directives:These begin with # symbol.These directives normally used to include the header files such as stdio.h,stdlib.h,math.h,string.h
eg:#include<stdio.h>
#include<math.h>
2)#error directive will print an implementation-dependent message including the tokens specified in the directive.
#pragma directive tokens are a series of characters that gives a specific compiler instruction and arguments,if any and causes an implementation-defined action.
3)#define directive specifies a macro identifier and a replacement list,and terminates with a new line character.
#undef directive cancels a previous definition of the identifier by #define.
Get Answers For Free
Most questions answered within 1 hours.