Reputation: 12890
If i use /clr mode to compile a code that has somthing like the following:
int x = 3;
char ch='A';
int arr[]="Hi";
array<int>^ ManArr1={44};
array<int>^ ManArr2= gcnew array<int> {44};
my questions now:
Would the type int
be mapped to System::Int32
?? and what about char ch
? Are they considerd as native or managed type? Where will be executed! through MSIL or not!!
We see that int arr[]
is a native array, does that mean it will be executed out of MSIL?
The last question ,, For both the managed array ManArr1
& ManArr2
what is the difference between the two initialization ??
Upvotes: 0
Views: 406
Reputation: 283624
When compiling with /clr
, your entire program is converted to MSIL unless you use #pragma managed(off)
or #pragma unmanaged
int
is equivalent to System::Int32
char
is equivalent to System::SByte
(not System::Char
!)Upvotes: 2
Reputation: 17434
Regarding "For both the managed array ManArr1 & ManArr2 what is the difference between the two initialization ??"
There is no functional difference, one is a shorthand for the other.
Upvotes: 1