Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

nuint: practical reference

nuint: practical reference: nuint is an unsigned integer whose width matches the native pointer size.

Version: C# built-in type reference; .NET 10 runtime

Syntax

nuint value

nuint is an unsigned integer whose width matches the native pointer size.

Use it for native sizes and unsigned address-like values.

Do not use it in a persistent format because its width depends on architecture.

Subtracting below zero wraps or throws in a checked context.

The complete program actually uses nuint; its exact expected stdout is System.UIntPtr.

Examples

using System;

Console.WriteLine(typeof(nuint).FullName);

Result

System.UIntPtr

The complete program actually uses `nuint`; its exact expected stdout is `System.UIntPtr`.

Sources