复制控件序列到新数组。
cli::array<Value>^ to_array();
备注
成员函数返回一控制序列的数组。 使用它包含控制的序列复制以数组形式。
示例
// cliext_stack_to_array.cpp
// compile with: /clr
#include <cliext/stack>
typedef cliext::stack<wchar_t> Mystack;
int main()
{
Mystack c1;
c1.push(L'a');
c1.push(L'b');
c1.push(L'c');
// copy the container and modify it
cli::array<wchar_t>^ a1 = c1.to_array();
c1.push(L'd');
for each (wchar_t elem in c1.get_container())
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// display the earlier array copy
for each (wchar_t elem in a1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
要求
页眉: </cliext 堆栈>
命名空间: cliext