C preprocessor: Difference between revisions

Jump to navigation Jump to search
New intro.
[unchecked revision][unchecked revision]
(New intro.)
Line 1:
{{Disputed|C preprocessor}}
== C preprocessor ==
 
The C preprocessor is a powerful tool and properly used may be very useful.
The C preprocessor is the first step in the process of translating C/C++ source code into a binary (preprocessing -> compiling -> linking). In trivial environments, the preprocessor is used only for '''#include'''ing header files, and providing "header guards" to avoid multiple inclusions.
The following have been checked to work in GCC.
 
But the preprocessor can do much more, and can be very useful - not only for C/C++ sources, but for your Assembler sources just as well.
 
It should be used with care and moderation though, because it can also obfuscate your source code and introduce bugs that are very difficult to debug.
 
=== Rules ===
 
<source lang="c">
#ifdef SOME_MACRO
Line 24 ⟶ 28:
that the preprocessor can be used with languages other than C. The standard way to invoke the preprocessor with GCC is "gcc -E".
{{stub}}
 
=== Uses ===
 
448

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu