1
I’m doing an exercise with vectors where I need to read two vectors of 5 positions each, and after that, concatenate these two into a 3 of 10 positions.
My program is correctly printing the first vector, but in the second it prints 4, 5, 5, 2686760, 1987092020 (I think they are addresses).
Carry out the duties:
int criaVetor3(int v[], int v1[]){
int v3[10];
for(i=0; i<=4; i++){
v3[i] = v[i];
}
for(i=4; i<=9; i++){ // Começa no 5 elemento do vetor e vai até o 10
v3[i] = v1[i-5];
}
}
int mostraVetor3(int v[], int v1[]){
int v3[10];
for(i=0; i<=9; i++){
printf("O numero posicao [%d] e %d\n", i, v[i]);
}
}
Thank you very much, I did not put the whole code because it has some more functions and a menu, I put only the functions of the part I was having difficulty but anyway, I really appreciate the help!
– danibrum