C++ code:
person* NewPerson(void) { person p; /* ... */ return &p; //return pointer to person. }
C# code:
person
This will not work in C++ because you are returning a reference to a temporary which will be destroyed once the function is over. You need to create a new person on the heap and then return a reference to that.
new