c++ cli - Confusing between Native and Managed in CPP/CLI? -


if use /clr mode compile code has somthing following:

int x = 3; char ch='a'; int arr[]="hi"; array<int>^ manarr1={44}; array<int>^ manarr2= gcnew array<int> {44}; 

my questions now: type int mapped system::int32 ?? , char ch ? considerd native or managed type? executed! through msil or not!!

we see int arr[] native array, mean executed out of msil?

the last question ,, both managed array manarr1 & manarr2 difference between 2 initialization ??

when compiling /clr, entire program converted msil unless use #pragma managed(off) or #pragma unmanaged

  • int equivalent system::int32
  • char equivalent system::sbyte (not system::char!)
  • both of these types "primitive". managed code sees them managed types , native code sees native types.
  • native arrays use unverifiable msil (same c# pointers, example)

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -