>>I have a public method in a managed class similar to void foo(int i);
>>
[quoted text clipped - 5 lines]
>
> int is Int32 in .NET, and long is Int64. short is Int16.
Arggh! That's for C# and VB.NET. In C++/CLI, long is still a synonym for
int, and __int64 is the keyword corresponding to System::Int64 (and there is
also __int128).
> You may be confusing int with VB6's Integer, which was 16 bits.
>
>> Bruce
Tamas Demjen - 29 Dec 2006 18:27 GMT
> Arggh! That's for C# and VB.NET. In C++/CLI, long is still a synonym for
> int, and __int64 is the keyword corresponding to System::Int64 (and there is
> also __int128).
I would like to add that there's a new 64-bit integer type called long
long, which was introduced to replace the non-standard and awkward
__int64 type. I personally prefer long long or System::Int64 to __int64.
long long is part of C99 and will be part of ISO C++0x.
Tom