Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2005

Tip: Looking for answers? Try searching our database.

array as output parameter ???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cmrchs@yahoo.com - 30 Jun 2005 16:48 GMT
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] = 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]);

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

but nothing works...

thanks
Chris
James Park - 30 Jun 2005 17:05 GMT
void OutputParam(array<int>^% intArr)

> Hi,
>
[quoted text clipped - 34 lines]
> Comprehensive, categorised, searchable collection of links to ASP &
> ASP.NET resources...

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.