R
rob
Hi,
I'm a bit confused by the mapping of the native types int and long to
UInt32. I'm trying to bind a tracking reference to a native value type
and it works for Int32 % -> int but not for Int32 % -> long.
This page http://msdn2.microsoft.com/en-gb/library/0wf2yk2k(VS.80).aspx
states that both int & long map to Int32.
The following code prints "Hello World 1" rather than the expected
"Hello World 32". If I change the 2 long types to ints (as commented)
the code works as expected, printing "Hello World 32".
using namespace System;
void fUniversalArg(Int32 %var)
{
var = 32;
}
void fNativeArg(long *pVar /* int *pVar */)
{
fUniversalArg((Int32)*pVar);
}
int main(array<System::String ^> ^args)
{
// int var = 1;
long var = 1;
fNativeArg(&var);
Console::WriteLine(L"Hello World " + var);
return 0;
}
Any thoughts - I guess I am mising something...
Cheers
Rob
I'm a bit confused by the mapping of the native types int and long to
UInt32. I'm trying to bind a tracking reference to a native value type
and it works for Int32 % -> int but not for Int32 % -> long.
This page http://msdn2.microsoft.com/en-gb/library/0wf2yk2k(VS.80).aspx
states that both int & long map to Int32.
The following code prints "Hello World 1" rather than the expected
"Hello World 32". If I change the 2 long types to ints (as commented)
the code works as expected, printing "Hello World 32".
using namespace System;
void fUniversalArg(Int32 %var)
{
var = 32;
}
void fNativeArg(long *pVar /* int *pVar */)
{
fUniversalArg((Int32)*pVar);
}
int main(array<System::String ^> ^args)
{
// int var = 1;
long var = 1;
fNativeArg(&var);
Console::WriteLine(L"Hello World " + var);
return 0;
}
Any thoughts - I guess I am mising something...
Cheers
Rob