बिजनेस मार्केटिंग का लो कॉस्ट फंडा , अपने मोबाइल से ऑटो sms भेजकर मार्केटिंग करे विजिट करे http://autotextsms.com/ बिजनेस मार्केटिंग का लो कॉस्ट फंडा http://autotextsms.com/

Search This Blog

Translate

Showing posts with label pre-processors. Show all posts
Showing posts with label pre-processors. Show all posts

C Preprocessor Directives


C Preprocessor Directives

Before a C program is compiled in a compiler, source code is processed by a program called preprocessor. This process is called preprocessing.

The C Preprocessor is not a part of the compiler, but is a separate step in the compilation process.

C Preprocessor directives: Before a C program is compiled in a compiler, source code is processed by a program called preprocessor. This process is called preprocessing. Commands used in preprocessor are called preprocessor directives and they begin with “#” symbol.
 



Commands used in preprocessor are called preprocessor directives and they begin with ''#'' symbol. Below is the list of preprocessor directives that C language offers.



 Macro :

syntax:

#define

This macro defines constant value and can be any of the basic data types.

Macros. A macro is a fragment of code which has been given a name.



 Header file inclusion

syntax:

#include <file_name>

The source code of the file ''file_name'' is included in the main program at the specified place

 A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files.

  

Conditional compilation

syntax:

#ifdef, #endif, #if, #else, #ifndef

Set of commands are included or excluded in source program before compilation with respect to the condition

In computer programming, conditional compilation is compilation implementing methods which allow the compiler to produce differences in the executable produced controlled by parameters that are provided during compilation.





 Other directives

syntax:

#undef, #pragma

#undef is used to undefine a defined macro variable.

#Pragma is used to call a function before and after main function in a C program

C Program example List