Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# Errors for declaring array
Message
De
08/11/2009 11:44:22
 
 
À
08/11/2009 10:44:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
OS:
Vista
Database:
Visual FoxPro
Divers
Thread ID:
01433718
Message ID:
01433760
Vues:
41
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform