references in cli

  • Thread starter Thread starter Zoran Stipanicev
  • Start date Start date
Z

Zoran Stipanicev

Hi!

I have a problem in converting code below from native c++ to .net cli:

//native c++
typedef float tip;

tip* conteiner_;

tip& Element_(int r, int c)
{
return conteiner_[r];
}

I've tried this:
//.net cli
typedef System::Single tip;

array<tip>^ conteiner_;

tip& Element_(int r, int c)
{
return conteiner_[r];
}

but I get the error that "tip" can't be converted to "tip&".

Thx!

Best regards,
Zoran Stipanicev.
 
Zoran Stipanicev said:
//native c++
typedef float tip;

tip* conteiner_;

tip& Element_(int r, int c)
{
return conteiner_[r];
}

I've tried this:
//.net cli
typedef System::Single tip;

array<tip>^ conteiner_;

tip& Element_(int r, int c)
{
return conteiner_[r];
}

but I get the error that "tip" can't be converted to "tip&".
tip& is an unmanaged reference. If you want what the CLR
calls a managed pointer you should use tip%.

-hg
 
Back
Top