0
I am trying to compile my code, but the compilation returns the following error:
a Function-Definition is not allowed here before '{' token|
I am beginner and I have looked several times the code to understand what may be happening, but I did not find the origin of the error.
void menuAlunoCurso(){
opcao = 0;
system("cls");
printf("\t\t\tSisCA - Menu do Matriculado *****");
printf("\n\n\t\t\t *** Escolha uma opção ***");
printf("\n\t\t\t 1------Cadastrar");
printf("\n\t\t\t 2------Exibir");
printf("\n\t\t\t 3------Pesquisar");
printf("\n\t\t\t 4------Remover");
printf("\n\t\t\t 7------Voltar ao menu anterior");
printf("\n\n\t\t\tOpção: ");
scanf("%d",&opcao);
}
Could someone help me, please? Until yesterday the code ran perfectly.
Do you only have that part of the code? Because I circled it here and it worked. Actually I just made a modification in which I put the type of the option variable. Getting
int opcao = 0;
– Leonardo Coelho
Probably your function is inserted in an inappropriate location. Please edit the question to show all possible code. @Leonardocoelho I think this variable is defined outside the function.
– felipeptcho
@felipeptcho may be that yes, because as I said, here it worked the way I tried.
– Leonardo Coelho