Visual C++ .NET/Function/Function Return — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 15:05, 26 мая 2010

Return a Pointer from a Function

<source lang="csharp">

  1. include "stdafx.h"
  2. include <typeinfo.h>
  3. 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>