Arrays?

Jul 1, 2010 at 3:50 AM

I am trying to make an array of integers.  I tried

int[] testArray=new int[4];
testArray[0]=0;
testArray[1]=1;
testArray[2]=2;
testArray[3]=3;
Console.WriteLine(testArray[3]);
But when I run it, it prints some random number.  When I declare it any other way, Visual Studio gives me an error.  Any help?

Coordinator
Jul 1, 2010 at 8:12 AM
does Console.WriteLine(testArray[3].ToString()) work?

On Thu, Jul 1, 2010 at 4:50 AM, mattloto <notifications@codeplex.com> wrote:

From: mattloto

I am trying to make an array of integers.  I tried

int[] testArray=new int[4];
testArray[0]=0;
testArray[1]=1;
testArray[2]=2;
testArray[3]=3;
Console.WriteLine(testArray[3]);
But when I run it, it prints some random number.  When I declare it any other way, Visual Studio gives me an error.  Any help?

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jul 1, 2010 at 3:45 PM

*facepalm*

Yes, it works.  Thanks for the help.