Skip to content

Commit 378f0e0

Browse files
authored
Merge pull request #6461 from dotnet/master
Update live with current master
2 parents 60ddd2f + d7c1ab1 commit 378f0e0

29 files changed

+152
-469
lines changed

.openpublishing.redirection.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,14 @@
13421342
"source_path":"docs/visual-basic/programming-guide/concepts/threading/walkthrough-multithreading-with-the-backgroundworker-component.md",
13431343
"redirect_url":"/dotnet/api/system.componentmodel.backgroundworker"
13441344
},
1345+
{
1346+
"source_path":"docs/csharp/programming-guide/concepts/threading/parameters-and-return-values-for-multithreaded-procedures.md",
1347+
"redirect_url":"/dotnet/standard/threading/creating-threads-and-passing-data-at-start-time"
1348+
},
1349+
{
1350+
"source_path":"docs/visual-basic/programming-guide/concepts/threading/parameters-and-return-values-for-multithreaded-procedures.md",
1351+
"redirect_url":"/dotnet/standard/threading/creating-threads-and-passing-data-at-start-time"
1352+
},
13451353
{
13461354
"source_path":"docs/fsharp/language-reference/primitive-types.md",
13471355
"redirect_url":"/dotnet/fsharp/language-reference/basic-types",

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_1.cs

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_2.cs

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_3.cs

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_4.cs

Lines changed: 0 additions & 47 deletions
This file was deleted.

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_5.cs

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_6.cs

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_7.cs

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/csharp/programming-guide/arrays/codesnippet/CSharp/passing-arrays-as-arguments_8.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
---
2-
title: "Passing Arrays as Arguments (C# Programming Guide)"
2+
title: "Passing arrays as arguments (C# Programming Guide)"
33
ms.date: 07/05/2018
44
helpviewer_keywords:
55
- "arrays [C#], passing as arguments"
66
ms.assetid: f3a0971e-c87c-4a1f-8262-bc0a3b712772
77
---
8-
# Passing Arrays as Arguments (C# Programming Guide)
9-
Arrays can be passed as arguments to method parameters. Because arrays are reference types, the method can change the value of the elements.
10-
11-
## Passing Single-Dimensional Arrays As Arguments
12-
You can pass an initialized single-dimensional array to a method. For example, the following statement sends an array to a print method.
13-
14-
[!code-csharp[csProgGuideArrays#34](codesnippet/CSharp/passing-arrays-as-arguments_1.cs)]
15-
16-
The following code shows a partial implementation of the print method.
17-
18-
[!code-csharp[csProgGuideArrays#33](codesnippet/CSharp/passing-arrays-as-arguments_2.cs)]
19-
20-
You can initialize and pass a new array in one step, as is shown in the following example.
21-
22-
[!code-csharp[CsProgGuideArrays#35](codesnippet/CSharp/passing-arrays-as-arguments_3.cs)]
23-
24-
## Example
25-
26-
### Description
27-
In the following example, an array of strings is initialized and passed as an argument to a `DisplayArray` method for strings. The method displays the elements of the array. Next, the `ChangeArray` method reverses the array elements, and then the `ChangeArrayElements` method modifies the first three elements of the array. After each method returns, the `DisplayArray` method shows that passing an array by value does not prevent changes to the array elements.
28-
29-
### Code
30-
[!code-csharp[csProgGuideArrays#30](codesnippet/CSharp/passing-arrays-as-arguments_4.cs)]
31-
32-
## Passing Multidimensional Arrays As Arguments
33-
You pass an initialized multidimensional array to a method in the same way that you pass a one-dimensional array.
34-
35-
[!code-csharp[csProgGuideArrays#41](codesnippet/CSharp/passing-arrays-as-arguments_5.cs)]
36-
37-
The following code shows a partial declaration of a print method that accepts a two-dimensional array as its argument.
38-
39-
[!code-csharp[csProgGuideArrays#36](codesnippet/CSharp/passing-arrays-as-arguments_6.cs)]
40-
41-
You can initialize and pass a new array in one step, as is shown in the following example.
42-
43-
[!code-csharp[csProgGuideArrays#32](codesnippet/CSharp/passing-arrays-as-arguments_7.cs)]
44-
45-
## Example
46-
47-
### Description
48-
In the following example, a two-dimensional array of integers is initialized and passed to the `Print2DArray` method. The method displays the elements of the array.
49-
50-
### Code
51-
[!code-csharp[csProgGuideArrays#31](codesnippet/CSharp/passing-arrays-as-arguments_8.cs)]
52-
53-
## See Also
54-
[C# Programming Guide](../../../csharp/programming-guide/index.md)
55-
[Arrays](index.md)
56-
[Single-Dimensional Arrays](single-dimensional-arrays.md)
57-
[Multidimensional Arrays](multidimensional-arrays.md)
58-
[Jagged Arrays](jagged-arrays.md)
8+
# Passing arrays as arguments (C# Programming Guide)
9+
10+
Arrays can be passed as arguments to method parameters. Because arrays are reference types, the method can change the value of the elements.
11+
12+
## Passing single-dimensional arrays as arguments
13+
14+
You can pass an initialized single-dimensional array to a method. For example, the following statement sends an array to a print method.
15+
16+
[!code-csharp[csProgGuideArrays#34](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/Arrays.cs#34)]
17+
18+
The following code shows a partial implementation of the print method.
19+
20+
[!code-csharp[csProgGuideArrays#33](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/Arrays.cs#33)]
21+
22+
You can initialize and pass a new array in one step, as is shown in the following example.
23+
24+
[!code-csharp[CsProgGuideArrays#35](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/Arrays.cs#35)]
25+
26+
### Example
27+
28+
In the following example, an array of strings is initialized and passed as an argument to a `DisplayArray` method for strings. The method displays the elements of the array. Next, the `ChangeArray` method reverses the array elements, and then the `ChangeArrayElements` method modifies the first three elements of the array. After each method returns, the `DisplayArray` method shows that passing an array by value doesn't prevent changes to the array elements.
29+
30+
[!code-csharp[csProgGuideArrays#30](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/ArrayExample.cs)]
31+
32+
## Passing multidimensional arrays as arguments
33+
34+
You pass an initialized multidimensional array to a method in the same way that you pass a one-dimensional array.
35+
36+
[!code-csharp[csProgGuideArrays#41](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/Arrays.cs#41)]
37+
38+
The following code shows a partial declaration of a print method that accepts a two-dimensional array as its argument.
39+
40+
[!code-csharp[csProgGuideArrays#36](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/Arrays.cs#36)]
41+
42+
You can initialize and pass a new array in one step, as is shown in the following example:
43+
44+
[!code-csharp[csProgGuideArrays#32](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/Arrays.cs#32)]
45+
46+
### Example
47+
48+
In the following example, a two-dimensional array of integers is initialized and passed to the `Print2DArray` method. The method displays the elements of the array.
49+
50+
[!code-csharp[csProgGuideArrays#31](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideArrays/CS/Arrays.cs#31)]
51+
52+
## See also
53+
54+
[C# Programming Guide](../index.md)
55+
[Arrays](index.md)
56+
[Single-Dimensional Arrays](single-dimensional-arrays.md)
57+
[Multidimensional Arrays](multidimensional-arrays.md)
58+
[Jagged Arrays](jagged-arrays.md)

0 commit comments

Comments
 (0)