error C2665: 'System::Console::WriteLine' : none of the 19 overloads can convert parameter 2 from type 'int' boXPin.cpp(7): could be 'void System::Console::WriteLine(System::String __gc *,System::Object __gc *)' boxpin.cpp(7): or 'void System::Console::WriteLine(System::String __gc *,System::Object __gc * __gc[])' while trying to match the argument list '(char [9], int)'
Console::WriteLine("x is {0}",__box(x));封装一个值的类别就是把值放到一个临时对象(这个对象是System::Object继续类的实例,存于垃圾收集堆)中,然后再把临时对象的地址传递给方法调用。原有变量中所有的东西都被拷入临时对象中,这个对象提供WriteLine()需要的所有功能。__box要害字意味着值类型和可治理类型都适合于基本类库提供的所有服务。