bool ./. Boolean

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

is there a difference in using int or System.Int32 in C++ .NET ?
Or more general using the .NET Framework type instead of the C++ types ?
Performance ?
What's the best practice ?

Thanks
Carl
 
Hi Carl,
is there a difference in using int or System.Int32 in C++ .NET ?

Not generally, no. The only difference is when it involves pointers or
references (the .NET types by default imply __gc, while int,short, etc. by
default imply __nogc).
Or more general using the .NET Framework type instead of the C++ types ?
Performance ? Nope.

What's the best practice ?

Whatever one you like, as long as you understand what's going on.
 
I have found the hard way that there is a difference in one situation:
if youare creating a .NET class library to be used by other languages
then your public methods should use Int16, Boolean and other such _gc
types. If not, VB doesn't understand the parameter types in your
methods (although VC++ and C# both understand int, short, long,
bool, etc. with no problems at all).
 
Back
Top