C++ concatenate two int arrays into one larger array

前端 未结 6 2118
小蘑菇
小蘑菇 2020-12-08 16:20

Is there a way to take two int arrays in C++

int * arr1;
int * arr2;
//pretend that in the lines below, we fill these two arrays with different
//int values
         


        
6条回答
  •  一整个雨季
    2020-12-08 16:39

    Here is the solution for the same-

    #include
    #include
    using namespace std;
    void Concatenate(char *s1,char *s2)
    {
        char s[200];
        int len1=strlen(s1);
        int len2=strlen(s2);
        int j;
        ///Define k to store the values on Kth address Kstart from 0 to len1+len2;
        int k=0;
    
            for(j=0;j

    Hope it helps.

提交回复
热议问题