Hello, I have 2 arrays unsorted, and I need to merge them together and then sorted. But I really don´t know, how to do it. Could you please help me? Thanks.
Code:
//Array 1:
int i=0;
int *array=new int[14];
int y = 14;
int x = 0;
ifstream in("somefile.txt", ios::in |ios::binary);
while(in >> array[x] && x < y)
{x++;}
for(i = 0; i < 14; i++)
{ cout << array[i] << endl;}
//Array 2:
int j=0;
int *arra=new int[14];
int z = 14;
int h = 0;
ifstream in("somefile2.txt", ios::in |ios::binary);
while(in >> arra[h] && h < z)
{h++;}
for(j = 0; j < 14; j++)
{ cout << arra[j] << endl;}
Comment