VaVa
VaVa

Reputation: 410

C# documentation examples

I am a newbie in comp. programming and have difficulty understanding the examples in the C# documentation. For example, the beginning of the Arrays as Objects section in the MSDN programming guide goes like this.

You can use the properties, and other class members, that Array has. The following code assigns the length of the numbers array, which is 5, to a variable called lengthOfNumbers:

C#

using System;
using System.Text;

Now, I don't see any numbers array and no variable called lengthOfNumbers. Please help my code-resistant brain get this. Thank you!

Upvotes: 1

Views: 281

Answers (1)

Patrick Hofman
Patrick Hofman

Reputation: 156978

This is just a borked MSDN example. Nothing to worry about.

The Visual Studio 2013 version does show the expected code:

int[] numbers = { 1, 2, 3, 4, 5 };
int lengthOfNumbers = numbers.Length;

Upvotes: 2

Related Questions