English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i'm a beginner in programming and need help with combining arrays. here's what i have: int a[]= {2,34,55,23,5, 21,4};
int aa[]= {22,7,11,3,98,4,32};

could anyone please help???????????

2007-01-25 17:21:14 · 2 answers · asked by ~Chocolate Delight~ 2 in Computers & Internet Programming & Design

2 answers

int a[] = {2,34,55,23,5,21,4};
int aa[] = {22,7,11,3,98,4,32};
int b[100];

strcpy(b,a,);
strcat(b,aa);
//b = 2,34,55,23,5,21,4,22,7,11,3,98,4,32

2007-01-26 01:31:49 · answer #1 · answered by justme 7 · 0 0

your best best is to create a new array the size of a and aa combined. So in other words an array of size 14 in the example you gave. Then put the first array in it and then the second array in it. You now formed a new array with aa appended to a.

2007-01-26 01:28:04 · answer #2 · answered by Ra R 2 · 0 0

fedest.com, questions and answers