Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# Errors for declaring array
Message
From
08/11/2009 11:44:22
 
 
To
08/11/2009 10:44:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01433718
Message ID:
01433760
Views:
42
And the following is illegal yet again in all versions:
>
>
>public class test
>{
> int[] numbers;
> numbers = new int[10]; // need to be in a single line
> static void Main()
> {
>   int[] myNumbers;
>   myNumbers = new int[10];
> }
>}
>


I'd like to add that this would be legal as well:
public class test
{
 int[] numbers;
 static void Main()
 {
    this.numbers = new int[10]; // initialized here instead of in declarations

    int[] myNumbers;
>   myNumbers = new int[10];
 }
}
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform