C# equivalent of C++/CLI data types

Go To StackoverFlow.com


What would be C# equivalent?

private array<__int32>^ func()
2012-04-03 19:58
by user1298416
private int[] func() ? Never programmed with C++/CLI so I'm not sure - NoName 2012-04-03 19:59
Be a bit careful with types like __int32. That's a type that will never change size, not even on the 256-bit machine that computes your retirement fund balance some day. Both C# and C++ use int as an alias to future-proof the languages. If you keep it then Int32[] func() is appropriate - Hans Passant 2012-04-03 20:23
That's not valid C++/CLI code. In C++, private is not a per-member modifier - Ben Voigt 2012-04-05 16:25


The right type should be:

private int[] func()

or even

private List<int> func()
2012-04-03 20:05
by rscarvalho


Although I never programmed in C++/CLI, I think these are the types you are looking for:

  • Simple array: int[]
  • Dynamically expanding array: List<int>
2012-04-03 20:04
by Tibi