![]() Directives are handled by the preprocessor, which is either a separate program invoked by the compiler or part of the compiler itself.Ĭ has some features as part of the language and some others as part of a standard library, which is a repository of code that is available alongside every standard-conformant C compiler. 2 Useful Preprocessor Macros for Debuggingĭirectives are special instructions directed to the preprocessor (preprocessor directive) or to the compiler (compiler directive) on how it should process part or all of your source code or set some flags on the final object and are used to make writing source code easier (more portable for instance) and to make the source code more understandable.1.8 #if,#else,#elif,#endif (conditionals).NOTE: Technically the output of the preprocessing phase for C consists of a sequence of tokens, rather than source text, but it is simple to output source text which is equivalent to the given token sequence, and that is commonly supported by compilers via a -E or /E option - although command line options to C compilers aren't completely standard, many follow similar rules. These transformations are lexical, meaning that the output of the preprocessor is still text. The preprocessor is a part of the compiler which performs preliminary operations (conditionally compiling code, including files etc.) to your code before the compiler sees it. All Preprocessor directives begin with the # (hash) symbol.Ĭ++ compilers use the same C preprocessor. ![]() The Preprocessor looks through the program trying to find out specific instructions called Preprocessor directives that it can understand. ![]() Before the actual compilation of every C program it is passed through a Preprocessor. Preprocessors are a way of making text processing with your C program before they are actually compiled. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |