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

can i see an example of double-array returning function?
thanks
Carl3003Asked:
Who is Participating?
 
vinhnlCommented:
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
 
vinhnlCommented:
What you mean?
0
 
Carl3003Author Commented:
something like this is in C++,

public array MyArray( .. , ...)
{
    array newArray;
    return newArray;
}
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
vinhnlCommented:
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
 
Carl3003Author Commented:
this is in C++?
Is it the same in C#?
0
 
vinhnlCommented:
oui
0
 
vinhnlCommented:
yes
0
 
Carl3003Author Commented:
ok thanks..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.