-1
When I call this function happens this error "Program Received Signal SIGSEGV, Segmentation fault."
void cria_agenda(Agenda *agenda_prof, int Id_prof, char *nome, int ano){
agenda_prof->quant_compromissos = 0;
agenda_prof->Id_prof = Id_prof;
strcpy(agenda_prof->nome_prof, nome);
agenda_prof->ano = ano;
}
The call and that:
Agenda *agenda_prof[P];
int tam_agenda = 0;
char *nome = "felipe";
int ano = 2020;
cria_agenda(agenda_prof[tam_agenda],tam_agenda, nome,ano);
I think I should allocate memory to the pointer first
– Samuel Ives