Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# Errors for declaring array
Message
De
08/11/2009 12:00:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/11/2009 11:44:22
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:
01433761
Vues:
37
>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];
> }
>}
>>
Yes, as long as :

myNumbers = new int[10];

is not in member declaration area.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform