unboxing int : Boxing Unboxing « Data Type « Visual C++ .NET






unboxing int

 
#include "stdafx.h"
using namespace System;

Object^ f(Object^ obj)
{
   Console::WriteLine("In f, with " + obj->ToString() + ".");
   return obj;
}

int main()
{
   int i = 1;
   int j = safe_cast<int>( f(i) );  

}

   
  








Related examples in the same category

1.Boxing in Action