Visual C++ .NET/Statement/macro

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

Defined macro

<source lang="csharp">

  1. include "stdafx.h"

using namespace System;

  1. define DISAPPEARS
  2. define ONE 1
  3. define TWO 2
  4. define POW2(x) (x)*(x)

void main() {

   Console::Write("The follow symbol disappears->" DISAPPEARS);
   Console::WriteLine("<-");
   Int32 x = TWO;
   Int32 y = POW2(x + ONE);
   Console::WriteLine(y);

}

 </source>