Skip to content

Commit b224e41

Browse files
Mention C# native integers in IntPtr/UIntPtr docs (#7364)
* Update IntPtr.xml * Update UIntPtr.xml
1 parent d88edb1 commit b224e41

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

xml/System/IntPtr.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
The <xref:System.IntPtr> type is CLS-compliant, while the <xref:System.UIntPtr> type is not. Only the <xref:System.IntPtr> type is used in the common language runtime. The <xref:System.UIntPtr> type is provided mostly to maintain architectural symmetry with the <xref:System.IntPtr> type.
108108
109109
This type implements the <xref:System.Runtime.Serialization.ISerializable>, and, in .NET 5.0 and later, the <xref:System.IFormattable> interfaces.
110+
111+
In C# starting from version 9.0, you can use the built-in `nint` type to define native-sized integers. This type is represented by the <xref:System.IntPtr> type internally and provides operations and conversions that are appropriate for integer types. For more information, see [nint and nuint types](/dotnet/csharp/language-reference/builtin-types/nint-nuint).
110112
111113
## Examples
112114

xml/System/UIntPtr.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
The <xref:System.UIntPtr> type can be used by languages that support pointers, and as a common means of referring to data between languages that do and do not support pointers. <xref:System.UIntPtr> objects can also be used to hold handles.
111111
112112
This type implements the <xref:System.Runtime.Serialization.ISerializable>, and, in .NET 5.0 and later, the <xref:System.IFormattable> interfaces.
113+
114+
In C# starting from version 9.0, you can use the built-in `nuint` type to define native-sized integers. This type is represented by the <xref:System.UIntPtr> type internally and provides operations and conversions that are appropriate for integer types. For more information, see [nint and nuint types](/dotnet/csharp/language-reference/builtin-types/nint-nuint).
113115
114116
]]></format>
115117
</remarks>

0 commit comments

Comments
 (0)