Fernando,
First, If this is C# code you are trying to compile then it will not
compile. It is buggy with small syntex errors.
Second, after fixing those syntex errors this program it should not give you
any error, release or debug do not matter.
OutOfMemoryException is thrown when you don't have enought memory to run
application. Please post the code that you are using.
I am pasting running code below.
class MyClass
{
int[] a = new int[30];
int [,] b = new int[10,20];
public int SomeMethod()
{
return 0;
}
}
class OtherClass
{
MyClass[] cls = null;
public void DoSomething()
{
int a = 3000;
cls = new MyClass[a];
}
}
public class Class1
{
public static void Main()
{
OtherClass other = new OtherClass();
other.DoSomething();
Console.Read();
}
}
"Fernando Casero" <fe************@speedy.com.ar> wrote in message
news:O7**************@TK2MSFTNGP12.phx.gbl...
Hi, I'm programming on Visual C# Express Beta 2 and I have the following
code:
class MyClass
{
int[] a = new int[30]
int [,] b = new int[10,20]
public int SomeMethod()
}
class OtherClass
{
MyClass[] cls = null;
public void DoSomething()
{
int a = 3000;
cls = new MyClass[a];
}
}
class program
{
OtherClass other = new OtherClass();
public int main()
{
other.DoSomething()
}
}
When running on Debug , this code works as expected, but on Release I get
an
OutOfMemoryException allocatting the array on "cls = new MyClass[a]" when
calling "DoSomething"
Can someone help me to solve it?
Thanks in advance
Fernando