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

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

Версия 18:31, 26 мая 2010

Static Method demo

<source lang="csharp">

  1. include "stdafx.h"

using namespace System; ref class MyClass { private:

   static int x = 42;

public:

  static int get_x()
  {
     return x;
  }

}; void main() {

   Console::WriteLine ( MyClass::get_x() );

}

 </source>