Last active
November 15, 2023 05:43
-
-
Save iwkjosec/4f9b0827f5d591771c580c4306a24db6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
class Program | |
{ | |
static void Main() | |
{ | |
Console.WriteLine($"{nameof(RuntimeInformation.ProcessArchitecture),-20}: {RuntimeInformation.ProcessArchitecture}"); | |
Console.WriteLine($"{nameof(RuntimeInformation.OSArchitecture),-20}: {RuntimeInformation.OSArchitecture}"); | |
Console.WriteLine($"{nameof(Environment.OSVersion),-20}: {Environment.OSVersion}"); | |
Console.WriteLine($"{nameof(RuntimeInformation.OSDescription),-20}: {RuntimeInformation.OSDescription}"); | |
Console.WriteLine($"{nameof(RuntimeInformation.RuntimeIdentifier),-20}: {RuntimeInformation.RuntimeIdentifier}"); | |
Console.WriteLine($"{nameof(RuntimeInformation.FrameworkDescription),-20}: {RuntimeInformation.FrameworkDescription}"); | |
unsafe { int* p = (int*)0; } // unsafe | |
var tuple = (0, 1.0); // C# 7.0 | |
int default_expressions = default; // C# 7.1 | |
var digit_separator_after_base_specifier = 0b_0; // C# 7.2 | |
Span<int> stackalloc_initializers = stackalloc int[] { 1 }; // C# 7.3 | |
var ranges = (new int[10])[1..4]; // C# 8.0 | |
nint native_ints = 1; // C# 9.0 | |
const string constant_interpolated_strings = $""; // C# 10.0 | |
var utf8_string_literals = "0"u8; // C# 11.0 | |
int[] collection_expressions = [0]; // C# 12.0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment