Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# Errors for declaring array
Message
From
08/11/2009 12:00:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/11/2009 11:44:22
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01433718
Message ID:
01433761
Views:
38
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform