CLI字符串^数组:插入可能吗? [英] CLI string^ array: insertion possible?
本文介绍了CLI字符串^数组:插入可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一个方法可以将新字符串插入现有CLI String ^数组中的指定索引?
开头:
Hi,
is there a methode to insert a new string to a specified index within an existing CLI String^ array?
starting with:
array<String^>^ trio = {"Paul","Mary"};
// ...插入代码...
//并得到一个结果,好像......
// ... insertion code...
// and get a result as if ...
array<String^>^ trio = {"Peter","Paul","Mary"};
已初始化?
非常感谢
Lino
我尝试了什么:
google了很多,仔细阅读
- ...特别是:
- MSDN:第4章数组,字符串和指针
- Nish Ni shdan:C ++ / CLI中的数组
was initialized?
thanks a lot
Lino
What I have tried:
googled a lot, carefully read
- ... especialy:
- MSDN: Chapter 4 Arrays, Strings, and Pointers
- Nish Nishdan: Arrays in C++/CLI
推荐答案
数组是不可变的。一旦创建,在将旧数组内容复制到新数组时,如果不分配新数组并将对象插入所需位置,则无法更改它们。
Arrays are immutable. Once created they cannot be changed without allocating a new array and inserting the object where you want it while you copy the old array content to the new one.
这篇关于CLI字符串^数组:插入可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文