O'Reilly logo

C# Data Structures and Algorithms by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Structs

Within structs, you have access to many built-in types, which could be used either as keywords or types from the System namespace.

One of them is the Boolean type (the bool keyword), which makes it possible to store a logical value, that is, one of two values, namely true or false.

As for storing integer values, you can use one of the following types: Byte (the byte keyword), SByte (sbyte), Int16 (short), UInt16 (ushort), Int32 (int), UInt32 (uint), Int64 (long), and UInt64 (ulong). They differ by the number of bytes for storing values and therefore by the range of available values. As an example, the short data type supports values in the range from -32,768 to 32,767 while uint supports values in the range from 0 to 4,294,967,295. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required