ConcurrentStack<T>.CopyTo(T[], Int32) 方法

定義

從指定的陣列索引開始,將 ConcurrentStack<T> 元素複製到現有的一維 Array

public:
 virtual void CopyTo(cli::array <T> ^ array, int index);
public void CopyTo(T[] array, int index);
abstract member CopyTo : 'T[] * int -> unit
override this.CopyTo : 'T[] * int -> unit
Public Sub CopyTo (array As T(), index As Integer)

參數

array
T[]

一維 Array ,即從 中複製 ConcurrentStack<T>元素的目的地。 必須 Array 有零基索引。

index
Int32

複製開始的零基索引 array

實作

例外狀況

array 是空參考(Visual Basic 中無任何參考)。

index 小於零。

index 等於或大於 -或 的長度 array ,來源中的 ConcurrentStack<T> 元素數大於從 index 到 目的端的 array可用空間。

適用於

另請參閱