Visual C++ .NET/Data Type/Integer

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

Convert Integer to string to ToString method

<source lang="csharp">

  1. include "stdafx.h"

using namespace System; void main() {

   Console::WriteLine ( (1234567890).ToString() );

}

 </source>


Convert Integer to String to ToString(X)

<source lang="csharp">

  1. include "stdafx.h"

using namespace System; void main() {

   Console::WriteLine ( (0xABCDEF).ToString("X") );

}

 </source>


Perform Simple Math

<source lang="csharp">

  1. include "stdafx.h"
  2. using <mscorlib.dll>

using namespace System; int main(void) {

   int value1 = 10;
   int value2 = 10;
   int value3;
   value3 = ++value1 * 10;
   Console::WriteLine(value3);
   Console::WriteLine(value1);
   return 0;

}

 </source>