Hello.
I have a two structure arrays that are sorted. ı wanted to put these arrays into third array as a sorted. and then ı wanted to put these values into the file. into my array one and array two , there is no same number so ı thought something to puth them into third array.
However , with respect to my method, into structure array3 nothing write.
struct record array1[10];
struct record array2[10];
struct record array3[20];
.
.
.
.
int e=0,f=0,g=0;
while ( e!=10 || f!=10);
{
if(array1[e].ave<array2[f].ave)
{
array3[g]=array1[e];
e=e+1;
g=g+1;
}
else if ( array2[f].ave<array1[e].ave)
{
array3[g]=array2[f];
f=f+1;
g=g+1;
}
}
if(f==10)
{
for(int k=e; k<10;++k)
{
array3[g]=array1[k];
g=g+1;
}
}
else if ( e==10)
{
for (int j=f; j<10 ; ++j)
{
array3[g]=array2[j];
g=g+1;
}
}