C
Chris
Hi,
I declare an integer and use the ToString()-method (see code below) . That
works fine
Now, using the same integer do I use the GetType()-method --> compiler error
==> error C3610: 'Int32': value type must be 'boxed' before method 'GetType'
can be called
How come ? Both methods are inherited from System::Object, but must be used
differently ???
Code sample :
int i = 10;
Console::WriteLine(i.ToString()); ==> OK
Console::WriteLine(i.GetType()->Name); ==> compiler error
thanks
Chris
I declare an integer and use the ToString()-method (see code below) . That
works fine
Now, using the same integer do I use the GetType()-method --> compiler error
==> error C3610: 'Int32': value type must be 'boxed' before method 'GetType'
can be called
How come ? Both methods are inherited from System::Object, but must be used
differently ???
Code sample :
int i = 10;
Console::WriteLine(i.ToString()); ==> OK
Console::WriteLine(i.GetType()->Name); ==> compiler error
thanks
Chris