Boa noite Achei um exercício legal pra fazer mais não consigo fazer o código funcionar
#include <stdio.h>
#define NMAX1 5
#define NMAX2 8
int pc[NMAX1];
int cn[NMAX2];
int leitura(int aux, int pccn[aux]){
for (int i = 0; i < aux; i++){
printf("Informe a matricula: ");
scanf("%d", &pccn[i]);
}
return pccn;
}
void verificacao(int pc[NMAX1], int cn[NMAX2]){
for (int i = 0; i < NMAX1; i++){
for (int j = 0; j < NMAX2; j++){
if (cn[j] == NMAX1 || pc[i] == NMAX2){
if (pc[i] == cn[j]){
printf("%d", pc[i]);
}
}
}
}
}
int main(){
pc[NMAX1] = leitura(NMAX1, pc[NMAX1]);
cn[NMAX2] = leitura(NMAX2, cn[NMAX2]);
printf("\n\n");
verificacao(pc[NMAX1], cn[NMAX2]);
}
In function ‘main’:
tempCodeRunnerFile.c:35:34: warning: passing argument 2 of ‘leitura’ makes pointer from integer without a cast [-Wint-conversion]
35 | pc[NMAX1] = leitura(NMAX1, pc[NMAX1]);
| ^
| |
| int
tempCodeRunnerFile.c:8:26: note: expected ‘int *’ but argument is of type ‘int’
8 | int leitura(int aux, int pccn[aux]){
| ^
tempCodeRunnerFile.c:36:34: warning: passing argument 2 of ‘leitura’ makes pointer from integer without a cast [-Wint-conversion]
36 | cn[NMAX2] = leitura(NMAX2, cn[NMAX2]);
| ^
| |
| int
tempCodeRunnerFile.c:8:26: note: expected ‘int *’ but argument is of type ‘int’
8 | int leitura(int aux, int pccn[aux]){
| ^
tempCodeRunnerFile.c:40:19: warning: passing argument 1 of ‘verificacao’ makes pointer from integer without a cast [-Wint-conversion]
40 | verificacao(pc[NMAX1], cn[NMAX2]);
| ^
| |
| int
tempCodeRunnerFile.c:16:22: note: expected ‘int *’ but argument is of type ‘int’
16 | void verificacao(int pc[NMAX1], int cn[NMAX2]){
| ^
tempCodeRunnerFile.c:40:30: warning: passing argument 2 of ‘verificacao’ makes pointer from integer without a cast [-Wint-conversion]
40 | verificacao(pc[NMAX1], cn[NMAX2]);
| ^
| |
| int
tempCodeRunnerFile.c:16:37: note: expected ‘int *’ but argument is of type ‘int’
16 | void verificacao(int pc[NMAX1], int cn[NMAX2]){