473,320 Members | 1,982 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,320 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 1807
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.