From the course: C Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Exploring the preprocessor

Exploring the preprocessor - C Tutorial

From the course: C Essential Training

Start my 1-month free trial

Exploring the preprocessor

- [Instructor] The C preprocessor helps prepare a source code file for compiling. It uses preprocessor directives, instructions that are carried out before the source code is compiled to object code. These instructions help compile the source code, and they can provide some handy shortcuts. While they traditionally appear at the start of the source code file. Preprocessor directives can be used anywhere, providing they follow the proper format. They can also be disabled by enclosing them in a comment. The variety of preprocessor directives totals 12, and the most common are define and include. The format of a preprocessor directive is specific, it's different from C language syntax. The directive starts with a hash or pound character. This character is immediately followed by the directive, then comes a space and any options or arguments. A preprocessor directive ends with a new line, not a semi-colon. For the include…

Contents