int v. Int32, string v. String

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

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
 
Mark said:
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.)
 
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!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top