Preprocessor Directives in C

C - Preprocessor Directives - Definition and Usage

  • In C Language preprocessor is more or less the own language which can be a very powerful tool to the programmer .
  • All the preprocessor directives or commands begin with “#” .
  • Below is the list of preprocessor directives that C language offers .
C Preprocessor

C Preprocessors #define - Definition and Usage

  • In C Language, the #define directive allows the definition of macros within your source code.
  • These macro definitions allow constant values to be declared for use throughout your code.
  • This macro defines constant value and can be any of the basic data types..
 C Preprocessors #define

C Preprocessors #ifdef - Definition and Usage

  • If the value of expression is true, then the code that immediately follows the command will be compiled.
  • “#ifdef” directive checks whether the particular macro is defined or not.
C Preprocessors #ifdef

C Preprocessors #ifndef #endif - Definition and Usage

  • #ifndef exactly acts as reverse as #ifdef directive.
  • If particular macro is not defined, “If” clause statements are included in source file.
  • Otherwise, else clause statements are included in source file for compilation and execution.
  • #endif’ always matches the nearest ‘#ifdef’ (or ‘#ifndef’, or ‘#if’).
  • Also, we cannot start a conditional group in one file and end it in another.
  • The number of necessary #endif directives changes according to whether the elseif or #else directive is used.
C Preprocessors #ifndef #endif

C Type Casting - Definition and Usage

  • In C- Programming the type casting is used to convert the variable from one datatype to another data type, after we perform casting the variable datatype will be changed.
  • “stdlib.h” header file supports all the type casting functions in C language programing.
C Type Casting

View More Quick Examples

Related Searches to C - Preprocessor Directives in C

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.