Directive (programming): Difference between revisions

Content deleted Content added
m Cited source; added the solidity pragma keyword.
Tags: Mobile edit Mobile web edit
Line 11:
 
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.