c# add 2 arrays

T[] array1 = getOneArray();
T[] array2 = getAnotherArray();
T[] newArray = new T[array1.Length + array2.Length];
Array.Copy(array1, newArray, array1.Length);
Array.Copy(array2, 0, newArray, array1.Length, array2.Length);

0
1
Yewgeniy 95 points

                                    public static int[] AddArrays(int[] a, int[] b)
{
    int[] newArray = new int[a.Length];
    for (int i = 0; i<a.Length; i++)
    {
        newArray[i]=a[i]+b[i];
    }
    return newArray;
}

0
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
merge arrays in c# how to merge arrays c# merge two arrays in c# sum 2 arrays c# merge array in c# c# add two objects int array arrays merge c# merge trwo arrays c# c# join 2 arrays together c# append 2 arrays merging two arrays into a new one c# c# addition of arrays c# unite two arrays add two arrays together c# add to arrays together c# how to merge 2 string arrays in c# how to concatenate two arrays in c# c# add two array c# joining two arrays c# combine merge array data c# combine two arrays into one how to combine two array in c# c# connect two arrays c sharp combine arrays c# concatenate two arrays array merge program in c# concat 2 arrays c# c sharp merging 2 arrays to one how to merge 2 arrays in c# join two array c# concatenate 2 arrays in C# how to add two arrays c# c# add two arrays c# add 2 arrays together c# merge to arrays array merge C# Combining two arrays into a single array c# concat three arrays c# how to join 2 arrays c# how to concatenate 2 arrays in c# C# merge two double array c# join arrays together c# merge two object arrays c# join 2 arrays c# merge array items c# append two arrays combine to arrays c# concat two array c# c# double array adding numbers how to combine 2 int arrays c# c# conbine 2 arrays c# concat 2 arrays join two arrays c# How to join two arrays in c# How to join two arrays inc# c# add two varaibles to int array merging two arrays in c# combine two int arrays c# how to add only two numbers i the array c# c# concat many arrays c# concat 2 array add multiple array in C# how to add 2 arrays together c# c# sum two arrays how to concat 2 arrays in c# append 2 arrays c# how to merge array in C# c# concat two arrays c# merge int array c# array marge arrays zusammenfügen c# adding two arrays in c# put two arrays together c# c# merging two arrays how to mix two arrays together C# combining arrays in c# .Net core consolidate array c# merge 2 arrays two arrays in one array c# how to associate two array with eachother c# join arrays c# c# combine two arrays to one how to add two arrays in c# merge 2 arrays in c# how to add tow array togter c# combine 2 arrays c# compile two arrays in one c# add multiple elements to array c# how to compare two arrays c# put arrays into array c# merge two lists together c# c# join arrays how to merge two dataset in c# how to combine arrays in c# CONCATENAR 2 ARRAYS C# two arrays C# how can i get two arrays to merge into one in c# hwo to create two arrays c# combine two arrays in c# how to merge two arrrays in c# two different arrays in C# c# merge two array arrays c# with two arrays c# combine 2 arrays join between two array in C# array join arrays c# combine two lists of array to one c# how to add multiple arrays in list in c# c# add arrays together how to merge two arrays c# how to combine two arrays c# is there a way to combine two string arrays c# c# how to transfer two string arrays into one list join two array in c# join two array in nc# c# fusion array add two string arrays c# merge different type of array into one array c# merge array in .net core c# merge two arrays C# two array function c# merge arrays c# combine array merge arrays c# combine an Arrays C# to combine array in C# c# merge array combine two array c# merge 2 array c# c# merge two string arrays c# combine arrays c# join two arrays how to add arrays together c# combine arrays into new array c# combine arrays c# c# combine two arrays of objects merge 2 arrays c# how to join two arrays together c# c# how to make 2 array to one work with 2 arrays in c# how to connect all of arrays c# C# array merge C# merge tow arrays how to use 2 arrays in c# add two arrays c# combine array c# merge array c# merge two arrays c# add arrays together c# fusionner deux tab c# c# add 2 arrays add two array c# c# how to merge arrays how make 2*2 array combine int and string in c# how to merge arrays in c# c# combine two arrays c# how to merge two arrays combine 2 string arrays c# join 2 arrays c# merge two array c# array combine c# join multiple array value in c# c# join two string arrays c# join two array how to join two arrays c# combine two arrays c# combine arrays in c# how to combine two arrays in c#
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source