Slideshow

Monday 25 February 2013



Explain the following directives:
#elif #pragma #error 

Ans:
(i) ‘#elif’ is a preprocessor directive that provides alternate test facility.
`#elif' stands for “else if”. Like `#else', it goes in the middle of a conditional
group and subdivides it; it does not require a matching `#endif' of its own.
Like `#if', the `#elif' directive includes an expression to be tested. The text
following the `#elif' is processed only if the original `#if'-condition failed
and the `#elif' condition succeeds.

(ii) #pragma is an implementation oriented directive that specifies various
instructions to be given to the compiler.
#pragma name
causes compiler to perform “name”
(iii)#error is a preprocessor directive used to produce diagnostic messages
during debugging.
#error message
causes the compiler to display the error message and terminate processing

No comments:

Post a Comment