array as output parameter ???

  • Thread starter Thread starter cmrchs
  • Start date Start date
C

cmrchs

Hi,

I have a function that creates an array and want to use that array in the client.
but what is the syntax in C++.NET 2005 to specify an array as output param of a function ??

ref class Test
{
void OutputParam(array<int>^ intArr)
{
intArr = gcnew array<int>(3);
for(int i=0; i<intArr->Length; i++)
intArr = i*2;
}
};

Client :
r = gcnew Test();

array<int>^ intArr1 = nullptr;
r->OutputParam(intArr1);
for(int i=0; i<intArr1->Length; i++) --> CRASH
Console::Write(" {0}",intArr1);

I tried
void OutputParam(array<int>^ intArr)
void OutputParam(array<int>^^ intArr)

but nothing works...

thanks
Chris




**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Back
Top