Що таке Elif у препроцесорі C?


What is the Elif code in C?

The elif preprocessor directive in C is equivalent to an else if statement – it provides an alternate path of action when used with #if , #ifdef , or #ifndef directives. Execution enters the #elif block when the #if condition is false and the elif condition holds true (this is shown below).

What is the hashtag if in C?

The #if directive, with the #elif, #else, and #endif directives, controls compilation of portions of a source file. If the expression you write (after the #if) has a nonzero value, the line group immediately following the #if directive is kept in the translation unit.

How to end if in C?

In the C Programming Language, the #endif directive is used to define the following directives: #if, #ifdef , and #ifndef . Whenever the #endif directive is encountered in a program, it determines if the preprocessing of #if, #ifdef, or #ifndef has been completed successfully.

What is the meaning of Elif in C macro?

' #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.

‘ #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 …
La directive #if, avec les directives #elif, #else et #endif, contrôle la compilation des parties d’un fichier source.