我知道我可以在C++中做到这一点:
string s[] = {"hi", "there"};
但是,有没有办法以这种方式去关心一个数组而不去关心string s[]
呢?
例如:
void foo(string[] strArray){
// some code
}
string s[] = {"hi", "there"}; // Works
foo(s); // Works
foo(new string[]{"hi", "there"}); // Doesn't work
https://stackoverflow.com/questions/9626722
复制相似问题