i'm trying to concatenate 2 int arrays and after that i try to sort the resulted array. The reading works just fine,but i think there are some problems at the concatenate part.If someone can enlight me i'll be happy and excuse me for my rubbish english. NOTE: The code should be keept at a low lvl programming(like C++ rookie-all code in main) Code above:
int N, M,vect1[500],vect2[500];
cin>>N;
for(int i=0; i<N; i++)
cin>>vect1[i];
cin>>M;
for(int i=0; i<M; i++)
cin>>vect2[i];
int rez1 = sizeof(vect1) / sizeof(vect1[0]);
int rez2 = sizeof(vect2) / sizeof(vect2[0]);
int rez3=rez1+rez2;
vect1[N+rez3];
int j=0;
for(int i = rez1; i < rez3 ; i++`
{
vect1[i]=vect2[j];
j++;
}
int sortat = 0, aux;
while (sortat == 0)
{
sortat = 1;
for (int i = 1; i < rez3; ++i)
if (vect1[i] > vect1[i + 1])
{
sortat = 0;
// interschimbam pe v[i] cu v[i + 1]
aux = vect1[i];
vect1[i] = vect1[i + 1];
vect1[i + 1] = aux;
}} for(int i=0; i <rez3; i++)
cout<<vect1[i];
return 0;