.

Assignment Help with Preprocessor in C++

The preprocessor is the directive that gives the instructions to the compiler to process the information before the compilation and execution. All the preprocessors starts with # with white space character which appears before the preprocessors starts its process.

The # define preprocessor

This # define preprocessors directives create the symbolic constants which is called as macro. When this line appears in a file all subsequent occurrence of macro in the file will be replaced by replacement data before the data of the program is compiled. When the code is executed in the source code file when compiling it.


Assignment Help with Preprocessor in C++ By Online Tutoring and Guided Sessions from assignmenthippo.com


Example

Function Like Macros

Example

Conditional Compilation

There are number of directives that are used to compile selective portion of the program source code which is called as conditional compilation. The program can be compiled for debugging purpose that causes cerr statement to be compiled in the program.

Example

The # and ## Operators

These operators are available in c++ and ANSI C. the # operator causes a replacement token to be converted to a string.

Example

Predefined C++ Macros

LINE – contains current line number of the program.

FILE – contains current file name of the program.

DATE – contains the string of the form month/day/year

TIME – contains the string of the form hour:minute:second

.