Directive (programming): Difference between revisions

Content deleted Content added
Dcoetzee (talk | contribs)
m Skip redirect (assembly language)
Bluemoose (talk | contribs)
AWB Assisted clean up
Line 2:
 
==Overview==
Directives are used in several relatively low-level languages such as [[assembly programming]], [[C programming language|C]] and [[C plus plus|C++]]. In [[assembly language]], directives generally tell the assembler the target platform, delineate segments, and so on. In [[C plus plus|C++]], directives are used for conditional compiling, macros and including other files.
 
Directives are used in several relatively low-level languages such as [[assembly programming]], [[C programming language|C]] and [[C plus plus|C++]]. In [[assembly language]], directives generally tell the assembler the target platform, delineate segments, and so on. In [[C plus plus|C++]], directives are used for conditional compiling, macros and including other files.
 
==Examples==
 
===C/C++===
There are several preprocessor directives in [[C programming language|C]] and [[C plus plus|C++]]. The following are a few examples, but do not illustrate every directive or every situation in which one might find them. Note the lack of semicolons at the end of the lines: directives are instructions to the preprocessor, not the compiler, and they follow their own language grammar and rules.
 
There are several preprocessor directives in [[C programming language|C]] and [[C plus plus|C++]]. The following are a few examples, but do not illustrate every directive or every situation in which one might find them. Note the lack of semicolons at the end of the lines: directives are instructions to the preprocessor, not the compiler, and they follow their own language grammar and rules.
 
#include <iostream>