#include <stdio.h>
#include <stdlib.h>
void recebeNumCartas(int *nAlice, int *nBeatriz){
scanf("%d %d", nAlice, nBeatriz);
}
int achaMenor(int nAlice, int nBeatriz, int menor){
menor = nAlice;
if (nBeatriz < nAlice){
menor = nBeatriz;
}
return menor;
}
int realizaTroca(int nAlice, int nBeatriz, int menor){
int cartasAlice[nAlice];
int cartasBeatriz[nBeatriz];
int troca[menor * 2];
for (int i = 0; i < nAlice; ++i){
scanf("%d", cartasAlice[i]);
}
for (int j = 0; j < nBeatriz; ++j){
scanf("%d", cartasBeatriz[j]);
}
}
int main(void){
int nAlice = 0;
int nBeatriz = 0;
int menor = 0;
recebeNumCartas(&nAlice, &nBeatriz);
menor = achaMenor(nAlice, nBeatriz, menor);
realizaTroca(nAlice, nBeatriz, menor);
getchar();
getchar();
return 0;
}
I'm doing an exercise with the above code, but after the first loop of the function is performed, the program runs without any error message. I need some help to understand what's going on.