Open main menu

C Programming/Preprocessor reference

< C Programming

Preprocessor ReferenceEdit

The following preprocessor statements exist:

Statement Meaning
========= =======
#if       conditional
#ifdef    true iff identifier is a macro
#ifndef   true iff identifier is not a macro
#elif     continues a conditional
#else     continues a conditional
#endif    ends a conditional
#include  includes a file
#define   defines a macro
#undef    removes a previously defined macro
#line     changes the line number and file name
#error    specifies an error
#pragma   catchall

Some nonstandard compilers also specify #warning and #import.