Esempio n. 1
0
int main() {
    int len1 = 7;
    int len2 = 9;
    int len3 = len1 + len2;
    int src1[7] = { 1, 3, 3, 4, 5, 8, 9 };
    int src2[9] = { 1, 2, 2, 3, 4, 6, 7, 8, 10 };
    int target[len3];

    arrayMerge(target, src1, len1, src2, len2);
    for ( int i = 0; i < len3; i++ ) {
        printf("%d ", target[i]);
    }
    printf("\n");

    return 0;
}
Esempio n. 2
0
int main() {
    int len1 = 5;
    int len2 = 5;
    int len3 = len1 + len2;
    int src1[5] = { 1, 3, 5, 7, 9};
    int src2[5] = { 2, 4, 6, 8, 10};
    int target[len3];

    arrayMerge(target, src1, len1, src2, len2);
    for ( int i = 0; i < len3; i++ ) {
        printf("%d ", target[i]);
    }
    printf("\n");
    
    return 0;
}