473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

int v. Int32, string v. String

Is int to Int32 as string is to String?

If that's the case, then the following is logically equivalent:

//equivalent
int MyInt = 5000;
Int32 MyInt2 = 5000;

//equivalent
string MyString = "slick";
String MyString2 = "slick";

Correct? Is int then essentially an alias for Int32?

Thanks in advance.
Mark
Nov 16 '05 #1
5 1811
Mark <mf****@idonotlikespam.cce.umn.edu> wrote:
Is int to Int32 as string is to String?
Yes.
If that's the case, then the following is logically equivalent:

//equivalent
int MyInt = 5000;
Int32 MyInt2 = 5000;
Yup.
//equivalent
string MyString = "slick";
String MyString2 = "slick";
Yup.
Correct? Is int then essentially an alias for Int32?


Exactly. (Well, System.Int32 to be precise.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Mark wrote:
Is int to Int32 as string is to String?

If that's the case, then the following is logically equivalent:

//equivalent
int MyInt = 5000;
Int32 MyInt2 = 5000;

//equivalent
string MyString = "slick";
String MyString2 = "slick";

Correct? Is int then essentially an alias for Int32?


Yes. See this for further such alises -
http://msdn.microsoft.com/library/de...iltintypes.asp
Nov 16 '05 #3
Absolutely correct. Just an alias.

--
Mike Mayer, C# MVP
mi**@mag37.com
http://www.mag37.com/csharp/
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
Is int to Int32 as string is to String?

If that's the case, then the following is logically equivalent:

//equivalent
int MyInt = 5000;
Int32 MyInt2 = 5000;

//equivalent
string MyString = "slick";
String MyString2 = "slick";

Correct? Is int then essentially an alias for Int32?

Thanks in advance.
Mark

Nov 16 '05 #4
Mark wrote:
Is int to Int32 as string is to String?


Yes it is.

http://msdn.microsoft.com/library/de...iltinTypes.asp

// Bjorn A
Nov 16 '05 #5
int is a C# keyword that maps to the Int32 structure in the Framework.
string is a C# keyword that maps to a String class in the Framework. Make
sense?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
Is int to Int32 as string is to String?

If that's the case, then the following is logically equivalent:

//equivalent
int MyInt = 5000;
Int32 MyInt2 = 5000;

//equivalent
string MyString = "slick";
String MyString2 = "slick";

Correct? Is int then essentially an alias for Int32?

Thanks in advance.
Mark

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alex Ayzin | last post by:
Hi, I have a column in my WinGrid, that's being populated with numeric data, but it's of String datatype(business rule requires to have these numbers as varchars in DB). On top of that, I need...
1
by: phancey | last post by:
I am trying to invoke a web service method dynamically. I have created a generic function that takes a method name, string of parameters and calls the web method using System.Reflection: ...
3
by: Tim Osborne | last post by:
I want to know if a call to Convert.Int32 can handle a Culture specific string. I have the following code: string sText = "111,111,111"; int i; i = Convert.Int32(...
5
by: Mark | last post by:
Is int to Int32 as string is to String? If that's the case, then the following is logically equivalent: //equivalent int MyInt = 5000; Int32 MyInt2 = 5000; //equivalent string MyString =...
3
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
1
by: Hifni Shahzard | last post by:
Hi, I got a stored procedure, where it returns a value. But if I execute it. It gives an error as "Invalid cast from System.Int32 to System.Byte.". To make clear how do I execute this, below I'm...
1
by: Allen Maki | last post by:
Why can I get the index of the item of the array when I use string*, but can not get the index of the array when I use any other type (such as Int32)? This code will compile perfectly, but if I...
2
by: loga123 | last post by:
Hi All, I am using Link Button for DELETE on the gridview. When I click on DELETE link, I get the ArgumentOutOfRangeException. But...it deletes the record from table in the database. On...
1
by: loga123 | last post by:
Hi All, I am using Link Button for DELETE on the gridview. When I click on DELETE link, I get the ArgumentOutOfRangeException. But...it deletes the record from table in the database. On...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.