C#

HSN

Member
Joined
May 2, 2004
Messages
23
Hello,

This is my first post in this forum... and I hope that I find the proper answer my question :)
I think that I have to talk about my problem right in this forum... anyway my problem is with the following code:

Im a C/C++ programmer and I loop at C# as a C programmer point of you, thus I tried to initialize a 2D array as follows:

Code:
using System;

namespace CSharp_Scanner
{
	class scanner
	{
		static int [][] array = { {1,2}, {3,4} };

		static void Main(string[] args)
		{
		}
	}
}

but it tells that: Array initializer can only be used in a variable or a field initializer.

So please can anyone help me with initializing my array inside a class...? ;)
 
oh thanks PlausiblyDamp
I just forgot to create the 2d array like that. Thank you very much... :)
 
Back
Top