Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

What is the difference between the int and Int32 datatype, or String and string (lowercase)?

On Saturday, May 14th 2005 at 03:35 AM
By Andrew Pociu (View Profile)
****-   (Rated 3.6 with 9 votes)
Advertisement
More C# Resources
Int32 is the System.Int32 class, while int is an alias for System.Int32.
The same applies for String (uppercase S) which is System.String, while string (lowercase S) is an alias for System.String.
So basically int is the same thing as Int32, and string is the same thing as Int32. It's down to user's preference which one to use but most prefer to use int and string as they are easier to type and more familiar among C++ programmers.
Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this Knowledge Base article
Comment Current Comments
by harris k on Monday, November 28th 2005 at 01:38 PM

thanks for the info. i also think it is alias. if any other difference there please tell me. let me know that..

by Dhamodharan.C on Monday, December 12th 2005 at 03:28 AM

Int32 v = 5;
Console.WriteLine(v);
What is the output?
Please send the output to my mailId.

by Raja on Wednesday, January 18th 2006 at 01:29 AM

One Small correction.System.Int32 is a structure. Not a class.

by Rajani on Friday, February 24th 2006 at 07:18 AM

thanks for the good explanation for difference between string and String in c#

by Rajani on Friday, February 24th 2006 at 07:19 AM

thanks for the good explanation for difference between string and String in c#

by Nanda on Wednesday, March 8th 2006 at 01:30 PM

To gain more control over string initialization, declare a variable using the System.String data type and create a new instance using the new keyword. The System.String class contains several constructors that you can use to initialize the string value. There is no recommendation on whether you use the string keyword or the System.String class. The string keyword is simply an alias for this class, so it is all a matter of taste. We prefer using the string keyword, but this preference is purely aesthetic. For this reason, we simply refer to the System.String class as the string class or data type.

by sriram on Wednesday, April 26th 2006 at 03:44 PM

Then what is the use of using the aliases.

by Vaibhav Jain on Thursday, August 3rd 2006 at 04:15 AM

The info. is really useful. Pls. correct the typing mistake in the last statement.

by Purnima Ashok on Friday, August 11th 2006 at 04:49 AM

When you declare an int in C#, what you are actually declaring is an instance of a .Net struct, System.Int32.

by Siva Parasad on Thursday, September 28th 2006 at 12:13 AM

Thanks, I was wondering when i was not able to inherit System.Int32 class in my enumeration but when i inherit from int its working. This was very much useful in my project.

As my another friend had said that \"When you declare an int in C#, what you are actually declaring is an instance of a .Net struct, System.Int32.\" then How will i be able to inherit for int which is working.

by latha on Wednesday, May 23rd 2007 at 12:11 AM

int i;
int32 i:
both are same or not?

if both are not same what is the differcence?

please send reply.

Thanking you

by Netman on Wednesday, August 15th 2007 at 05:28 AM

int in 64 bit is int64
int in 32 bit is int32
if you want to use 32 bit int value in 64bit OS, you must define as int32.

by Kae-chan on Saturday, August 18th 2007 at 08:05 AM

@Netman

Ehh no, in .NET, byte is always 8 bits, char and short are always 16 bits, int is always 32 bits, and long is always 64 bits.
It is void* that is 32 bits on a 32 bit platform and 64 bits on a 64 bit platform.

by Trupti on Monday, September 10th 2007 at 12:52 AM

what is the difference between int16,int32,int64

by Andrei Pociu on Monday, September 10th 2007 at 01:50 AM

The difference is in how much they can store. Here is the value range of each (considering they\'re unsigned integers):

Int16: -32,768 to 32,767
Int32: -2,147,483,648 to 2,147,483,647
Int64: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

by khushbu desai on Monday, December 31st 2007 at 04:59 AM

thanks for the information that it is alias one.

by Mahender on Tuesday, January 15th 2008 at 03:44 AM

Guys,
How does Int32 and Int behaves in 64 bit OS and in 32 Bit OS

by test on Tuesday, January 29th 2008 at 03:25 PM

test

by Gaurav Arya on Thursday, February 7th 2008 at 01:33 AM

Good and straight explanation there! Thank you

by gdhdhh on Wednesday, December 10th 2008 at 10:52 PM

Mokka Naaigala pongada....

by Richa Beriwal on Wednesday, March 18th 2009 at 01:01 AM

Is int32 and smallint same?
I have used int as a datatype in my backend and int32 in my frontend asp.net ,but when user itrying to create a new user it gives error in application so i suppose int32 shuold be changed to int64 ?
Please help

by Khuram Jan on Wednesday, July 15th 2009 at 02:15 AM

I m confuse that as objets are allocated in heap while int type allocated in stack, as Int32 is a Class and its alias is int.
int x=10;
it means x is the variable of class type Int32 so why x is allocate memory in Stack instead of Heap as Int32 is class.

by Khuram Jan on Wednesday, July 15th 2009 at 02:16 AM

I m confuse that as objets are allocated in heap while int type allocated in stack, as Int32 is a Class and its alias is int.
int x=10;
it means x is the variable of class type Int32 so why x is allocate memory in Stack instead of Heap as Int32 is class.

by Basuki Priyam on Friday, August 28th 2009 at 08:02 AM

Int 32 is not class but Struct and as It is Value Type it will be allocated in Stack only. Only Reference Types such as Objects of any Class are allocated on stack and their refrences are allocated in Heap.

by Kannan Perumal on Tuesday, September 8th 2009 at 05:28 AM

short is pseudonym of Int16
int is pseudonym of Int32
long is pseudonym of Int64

Int16, Int32 and Int64 are all struct, not class. So, obvious why they are in stack and not in heap.

- Kannan Perumal

by HaSaN on Saturday, October 17th 2009 at 03:43 PM


Andrei Pociu

by Mahesh on Tuesday, February 22nd 2011 at 12:03 AM

Discussion is very useful Thank you ..

by ravindra on Wednesday, April 20th 2011 at 02:54 AM

very simple and useful info.

by on Tuesday, January 17th 2012 at 01:07 AM

Once you have recreated the problem and captured these steps, you can save them to a file and send it to your support person, who can then open it up and view

by aditya on Tuesday, March 13th 2012 at 03:42 AM

what are the different between the int,int16 ,int32,and int64. in c#

by aditya on Tuesday, March 13th 2012 at 03:42 AM

what are the different between the int,int16 ,int32,and int64. in c#


Comment Comment on this Knowledge Base article
Name: Email:
Message:
Knowledge Base Related Knowledge Base Articles
There are no related KB articles.

Comment Related Source Code
There is no related code.

Comment Related Tutorials
There are no related tutorials.

Jobs C# Job Search
My skills include:

Enter a City:

Select a State:


Advanced Search >>
Ads

From the creators of Geekpedia, a revolutionary new coupon website!

BargainEZ has coupons codes, printable coupons, bargains and it is the leading source of Passbook coupons for iPhone and iPod touch devices.

Coupons
Discover Geekpedia
Other Resources