Preprocessors

Introduction to preprocessor What would be even an average programmer, it is necessary to provide functionality to the preprocessor. To understand the basics let's deal with the wording: preprocessor – a program that performs editing the original code. Ie It converts the code before the start of the program. Many web-programmers use a preprocessor to write websites, such as PHP and fully all the programmers in C + +, C and C Sharp use the required guidelines for each program. With them are allowed to easily create all kinds of constants, input files, ie great destination. The following discussion focuses on the most common directives – define and include. Commissioning include include set up to connect to the file several alternatives.

Immediately easy to understand the need to include. Suddenly, our portal has 81 or more pages, and everywhere the same name or a directory. You can only attach required us to file with ease include clarification and to reduce the amount of code. In the C programming language in each program distributed connection specialized guidelines for what would be inserted into the function worked, but not buggy. Just no one forbids you to connect and various files, such as mathematical and physical functions.

Let us now see an ad in practice: # include # sign before each indicated executed directive. A file name is either in quotes or in. Define Define Learning is used when necessary to declare a constant. The current operation is much reduced control and change the code. Thus, sufficient to fix the constant specified in a location, for that would change all the values. In addition, you can specify in a define directive, even the expression, but better not to act, for that would not make a mistake. We show a practical example define: # define OO 16 # define QQ (v) (v * v) Look, do not contains a general assignment symbols have meaning, and, at the end has no place to be. The next line of code appears macros rather than function. Prior to compile all the values of the macro, define changes in the operation or operations. With the conclusion directives discussed by the apparent frugality of code and simplify its understanding. In the structural or objective oriented programming these directives play a tremendous role. If you comprehend programming in C or PHP, you often insert include and define.