outcome of: int i = new System.Int32(); ???

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Hey

I'm wondering what the outcome of this is C# code really is:
int i = new System.Int32();

Which one of these scenarios below describe what the outcome is:
#1: A new reference type instance of i set to zero
#2: An uninitialized i variable
#3: An initialized i variable set to zero

I originally thought #3 is the outcome, but i'm not sure any longer

Any suggestions?

Jeff
 
Jeff said:
I'm wondering what the outcome of this is C# code really is:
int i = new System.Int32();

Which one of these scenarios below describe what the outcome is:
#1: A new reference type instance of i set to zero
#2: An uninitialized i variable
#3: An initialized i variable set to zero

I originally thought #3 is the outcome, but i'm not sure any longer

#3

Int32 is a struct and the same as int.

Arne
 
Jeff said:
Hey

I'm wondering what the outcome of this is C# code really is:
int i = new System.Int32();

Which one of these scenarios below describe what the outcome is:
#1: A new reference type instance of i set to zero
#2: An uninitialized i variable
#3: An initialized i variable set to zero

I originally thought #3 is the outcome, but i'm not sure any longer

Any suggestions?

Jeff

Jeff,

What's causing the uncertainty about #3?

Brian
 

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