Advertisement
Online Test Banks
Score higher
See Online Test Banks
eLearning
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

C# 2008 Integer Variable Types

Part of the C# 2008 For Dummies Cheat Sheet

Each variable has a fixed type in C#, and integer (int) variable types are limited to whole numbers. C# has several other integer variable types, shown in this chart:

Type Size (bytes) Range In Use
sbyte 1 -128 to 127 sbyte sb = -12;
byte 1 0 to 255 byte b = 12;
short 2 -32,768 to 32,767 short sn = -123;
ushort 2 0 to 65,535 ushort usn = 123;
int 4 -2,147,483,648 to 2,147,483,647 int n = 123;
uint 4 0 to 4,294,967,295 uint un = 123U;
long 8 -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - “a whole lot” long l = 123L;
ulong 8 0 to 18,446,744,073,709,551,615 long ul = 123UL;
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement
Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win an iPad Mini. Enter to win now!