Visual C++ .NET/Function/Function Return
Return a Pointer from a Function
<source lang="csharp">
- include "stdafx.h"
- include <typeinfo.h>
- using <mscorlib.dll>
using namespace System; int *MyInteger() {
int *res = new int; *res = 10; return res;
} int main(void) {
int *x = MyInteger(); delete x; return 0;
}
</source>