473,480 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1212
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
393
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
5626
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
7750
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
1813
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
10233
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
4826
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
1487
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...
3
10237
by: keithb | last post by:
What could be causing this? this code: String Com = ""; if (Com != (String)rw.ItemArray) fails at runtime with the error message: Unable to cast object of type 'System.Int32' to type...
2
3454
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
2297
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
7106
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...
0
7022
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4501
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3013
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.