0% found this document useful (0 votes)
7 views2 pages

C# Data Types and Ranges Overview

This document summarizes the built-in data types in C#, including their aliases, sizes in bits, .NET types, ranges, and precision for numeric types. It includes integer types like sbyte, byte, short, ushort, int, uint, long, ulong. Floating-point types are float, double, and decimal. Other predefined types are bool, object, and string, along with character constants.

Uploaded by

Mahmoud Ibrahim
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

C# Data Types and Ranges Overview

This document summarizes the built-in data types in C#, including their aliases, sizes in bits, .NET types, ranges, and precision for numeric types. It includes integer types like sbyte, byte, short, ushort, int, uint, long, ulong. Floating-point types are float, double, and decimal. Other predefined types are bool, object, and string, along with character constants.

Uploaded by

Mahmoud Ibrahim
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

C#

Alias

Size
(bits)

.NET Type

Range

sbyte

[Link]
e

-128 to 127

byte

[Link]

0 to 255

short

System.Int16

16

-32,768 to 32,767

ushort

System.UInt1
6

16

0 to 65,535

char

[Link]

16

A unicode character of code 0 to 65,535

int

System.Int32

32

-2,147,483,648 to 2,147,483,647

uint

System.UInt3
2

32

0 to 4,294,967,295

long

System.Int64

64

-9,223,372,036,854,775,808 to
9,223,372,036,854,775,807

ulong

System.UInt6
4

64

0 to 18,446,744,073,709,551,615

Floating-point[edit]
C#
Alias

Size
(bits)

.NET Type

Precision

Range

float

[Link]

32

7 digits

1.5 x 10-45 to 3.4 x 1038

double

[Link]

64

15-16 digits

5.0 x 10-324 to 1.7 x


10308

decimal

[Link]
al

128

28-29 decimal
places

1.0 x 10-28 to 7.9 x 1028

Other predefined types[edit]


C#
Alias

.NET Type

Size
(bits)

Range

bool

[Link]
n

32

true or false, which aren't related to any integer


in C#.

object

[Link]

32/64

Platform dependant (a pointer to an object).

string

[Link]

16*length

A unicode string with no special upper bound.

Character Constant

Special Value

\n

New Line

\t

Tab

\0

Null

\r

Carriage Return

\\

Backslash

You might also like