[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
Solved

# can i see an example of double-array returning function?

Posted on 2005-04-24
Medium Priority
272 Views
can i see an example of double-array returning function?
thanks
0
Question by:Carl3003
• 5
• 3

LVL 8

Expert Comment

ID: 13856191
What you mean?
0

Author Comment

ID: 13856265
something like this is in C++,

public array MyArray( .. , ...)
{
array newArray;
return newArray;
}
0

LVL 8

Expert Comment

ID: 13856284
public int[] MyArray(int[] array1, int[] array2)
{
int[] newarray = new int[array1.Length+array2.Length];
for(int i=0;i<array1.Length;i++)
newarray[i] = array1[i];
for(int i=0;i<array2.Length;i++)
newarray[array2.Length+i] = array1[i];
return newarray;
}

???
0

LVL 8

Accepted Solution

vinhnl earned 200 total points
ID: 13856286
public int[] MyArray(int[] array1, int[] array2)
{
int[] newarray = new int[array1.Length+array2.Length];
for(int i=0;i<array1.Length;i++)
newarray[i] = array1[i];
for(int i=0;i<array2.Length;i++)
newarray[array1.Length+i] = array2[i];//<--
return newarray;
}

???
0

Author Comment

ID: 13856301
this is in C++?
Is it the same in C#?
0

LVL 8

Expert Comment

ID: 13856310
oui
0

LVL 8

Expert Comment

ID: 13856312
yes
0

Author Comment

ID: 13856379
ok thanks..
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
###### Suggested Courses
Course of the Month19 days, left to enroll