在C语言中,可以通过使用循环遍历的方法合并两个数组。具体步骤如下:
#define SIZE1 10
#define SIZE2 5
#define SIZE3 5
int result[SIZE1];
int arr1[SIZE2] = {1, 2, 3, 4, 5};
int arr2[SIZE3] = {6, 7, 8, 9, 10};
int i;
for (i = 0; i < SIZE2; i++) {
result[i] = arr1[i];
}
for (i = SIZE2; i < SIZE1; i++) {
result[i] = arr2[i - SIZE2];
}
最后,合并后的结果就存储在result数组中。