Directive (programming): Difference between revisions

Content deleted Content added
No edit summary
Tags: section blanking Mobile edit Mobile web edit
m Reverted edits by 27.77.108.97 (talk) to last version by 45.250.44.224
Line 4:
 
This term could be used to refer to proprietary third party tags and commands (or markup) embedded in code that result in additional executable processing that extend the existing compiler, assembler and language constructs present in the development environment. The term "directive" is also applied in a variety of ways that are similar to the term ''command''.
 
==The C preprocessor==
{{Main|C preprocessor}}
 
In [[C (programming language)|C]] and [[C++]], the language supports a simple [[Macro (computer science)|macro]] [[preprocessor]]. Source lines that should be handled by the preprocessor, such as <code>#define</code> and <code>#include</code> are referred to as ''preprocessor directives''.
 
Another C construct, the <code>#pragma</code> directive, is used to instruct the compiler to use pragmatic or implementation-dependent features. Two notable users of this directive are [[OpenMP]] and [[OpenACC]].
 
Syntactic constructs similar to C's preprocessor directives, such as [[C Sharp (programming language)|C#]]'s <code>#if</code>, are also typically called "directives", although in these cases there may not be any real preprocessing phase involved.
 
All preprocessor commands begin with a hash symbol (#).
 
==History==