The sizeof operator doesn't work on Int128 - C#

Shervan360 1,501 Reputation points
2024-08-26T11:09:34.5333333+00:00

Hello,

What are the differences between Int128 and other Int groups such as Int16, Int32, and Int64?

The sizeof operator doesn't work on Int128.

Screenshot 2024-08-26 141219

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,818 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 84,281 Reputation points
    2024-08-26T12:01:31.33+00:00

    As VS and doc say, it is not a predefined type

    It works inside unsafe { } or

    with Marshal.SizeOf(typeof(Int128) (or Marshal.SizeOf<Int128>())


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.