Content deleted Content added
No edit summary |
Tags: Mobile edit Mobile web edit |
||
Line 320:
The Objective-C directive should not be confused with the C++ keyword <code>import</code>, which is used to import C++ [[Precompiled header#Modules|modules]] (since [[C++20]]), and is not a preprocessor directive.
=== Nullable ===
The <code>#nullable</code> directive in C# is used to enable and disable nullable reference types. To enable them, use <code>#nullable enable</code>, and <code>#nullable disable</code> to disable them.
<syntaxhighlight lang="csharp">
#nullable enable
string? name = null; // OK
string fullName = null; // Warning: possible null assignment
#nullable disable
string test = null; // No warning
</syntaxhighlight>
=== Region ===
The <code>#region</code> and <code>#endregion</code> directives in C# are used to expand/collapse sections of code in IDEs, and has no effect on actual compilation of the program.
== Other uses ==
|