Mega Code Archive
Categories
/
Visual C++ .NET
/
Function
Return a Pointer from a Function
#include "stdafx.h" #include
#using
using namespace System; int *MyInteger() { int *res = new int; *res = 10; return res; } int main(void) { int *x = MyInteger(); delete x; return 0; }