动态创建变量C++/cli.NET 我在C++/CLI中导入一个文本文件: array<System::String^>^ Filelines = IO::File::ReadAllLines(path);
我有什么选择?我可以制作数组吗?您当然可以使用数组:动态创建变量C++/cli.NET 我在C++/CLI中导入一个文本文件: array<System::String^>^ Filelines = IO::File::ReadAllLines(path);,c++,.net,c++-cli,C++,.net,C++ Cli,我有什么选择?我可以制作数组吗?您当然可以使用数组: array<System::String^>^ Filelines = IO::File::ReadAllLines(path); array<array<System::String^>^> ^test = gcnew array<array<System::String^>^>(Filelines->Length); test[0] = Filelines[0]->S
array<System::String^>^ Filelines = IO::File::ReadAllLines(path);
array<array<System::String^>^> ^test = gcnew array<array<System::String^>^>(Filelines->Length);
test[0] = Filelines[0]->Split(',');
test[1] = Filelines[1]->Split(',');
array^Filelines=IO::File::ReadAllLines(路径);
数组^test=gcnew数组(文件行->长度);
测试[0]=文件线[0]->拆分(',');
测试[1]=文件线[1]->拆分(',');
使用列表^
@asawyer:type列表^
不存在,这样混合托管和非托管类型是不可能的。你可以做List^
或std::vector
甚至List^
@BenVoigt你当然是对的,谢谢你的澄清。
array<System::String^>^ Filelines = IO::File::ReadAllLines(path);
array<array<System::String^>^> ^test = gcnew array<array<System::String^>^>(Filelines->Length);
test[0] = Filelines[0]->Split(',');
test[1] = Filelines[1]->Split(',');