M
Mark Ingram
Hi, I have a function:
void MyFunction(Int32^ outVar)
{
if (outVar != nullptr)
{
*outVar = 32;
}
}
and code:
{
Int32 emptyVar;
MyClass->MyFunction(emptyVar);
}
a) Why does this compile, when I am not actually passing the address of
the variable through to the function?
b) Is that the correct way of doing it? I tried:
MyClass->MyFunction(&emptyVar);
But it moans about converting it from Int32* to Int32^.
Any tips welcome,
Cheers,
void MyFunction(Int32^ outVar)
{
if (outVar != nullptr)
{
*outVar = 32;
}
}
and code:
{
Int32 emptyVar;
MyClass->MyFunction(emptyVar);
}
a) Why does this compile, when I am not actually passing the address of
the variable through to the function?
b) Is that the correct way of doing it? I tried:
MyClass->MyFunction(&emptyVar);
But it moans about converting it from Int32* to Int32^.
Any tips welcome,
Cheers,