how to map *& in SWIG?
谷子 <[email protected]> Wed, 11 Jan 2023 15:38:35 +0800 (CST)
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <[email protected]> |
I have the below code in c++, p is a person array.
voidGetPersonArrayRef(Person*& p){
Person* plist = p;
for (int i = 0; i < 5; i++)
{
std::cout << (plist[i].name) << std::endl;
}
Person p0, p1, p2;
p0.name = "0name";
p1.name = "1name";
p2.name = "2name";
Person* a = new Person[3]{ p0,p1,p2 };
p = a;
}
the generated c# type is SWIGTYPE_p_p_Person of Person*&.
I want to call the method like this GetPersonArrayRef(ref Person[] list) in c# code. Can someone help?
If can't do like above, can give me any other tips?
_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user