Önceden Tanımlanmış Makrolar

1.7.7 Predefined Macros The following macros are already defined by the compiler and cannot be changed. __LINE__ A decimal constant representing the current line number. __FILE__ A string representing the current name of the source code file. __DATE__ A string representing the current date when compiling began for the current source file. It is in […]

Daha Fazla

#pragma

This #pragma directive allows a directive to be defined. Its effects are implementation-defined. If the pragma is not supported, then it is ignored. Syntax: #pragma directive Faydalı Yetersiz

Daha Fazla

#error

1.7.5 #error The #error directive will cause the compiler to halt compiling and return with the specified error message. Syntax: #error message Examples: #ifndef VERSION #error Version number not specified. #endif Faydalı Yetersiz

Daha Fazla

#line

1.7.4 #line The #line directive allows the current line number and the apparent name of the current sourcecode filename to be changed. Syntax: #line line-number filename Note that if the filename is not given, then it stays the same. The line number on the current line is one greater than the number of new-line characters (so the first […]

Daha Fazla

#include

1.7.3 #include The #include directive allows external header files to be processed by the compiler. Syntax: #include <header-file> or #include “source-file” When enclosing the file with < and >, then the implementation searches the known header directories for the file (which is implementation-defined) and processes it. When enclosed with double quotation marks, then the entire contents of […]

Daha Fazla

#define, #undef, #ifdef, #ifndef

1.7.2 #define, #undef, #ifdef, #ifndef The preprocessing directives #define and #undef allow the definition of identifiers which hold a certain value. These identifiers can simply be constants or a macro function. The directives #ifdef and #ifndef allow conditional compiling of certain lines of code based on whether or not an identifier has been defined. Syntax: #define identifier replacement-code #undef identifier #ifdef identifier #else or #elif #endif #ifndef identifier #else or #elif […]

Daha Fazla

#if, #elif, #else, #endif

1.7.1 #if, #elif, #else, #endif These preprocessing directives create conditional compiling parameters that control the compiling of the source code. They must begin on a separate line. Syntax: #if constant_expression #else #endif or #if constant_expression #elif constant_expression #endif The compiler only compiles the code after the #if expression if the constant_expression evaluates to a non-zero value (true). If the value is 0 […]

Daha Fazla