이제 확인해보십시오. 아무도 내가 풀 수없는 수수께끼가 있습니다. 어쩌면 초보자 이건 내가 알아서는 안되는 것입니다. 여기이 부분else 문이 잘못되었거나 컴파일러가 잘못 되었습니까?
int customer_menu(char signup(struct register_ regis))
{
FILE *cni; /* cni means customer necessary info*/
cni=fopen("login.txt","a+");
if(cni!=NULL)
{
if (regis.category=="customer")
/*This is where the compiler say the error is at. Expecting a ';' here?:*/
{
printf("\t\t~>~>~>~>~>~>~>menu~>~>~>~>~>~>~>~>~~ \n");
printf("\t\t~>~>~>~>~>~>~>~>~>~>~>~>~>>~>~>~>~>~ \n");
printf("\t\t~>~>~>~>>~>~>~>~>~>~>~>~>~>~>~>~>~>~ \n");
printf("\t\t~>~>~>~>~>to login~>~>~>~>~>~press 1 \n");
printf("\t\t~>~>~>~>~>to register~>~>~>~>press 2 \n");
printf("\t\t~>~>~>~>~>to buy ticket~>~>~>press 6 \n");
printf("\t\t~>~>~>~>~>to exit~>~>~>~>~>~>press 0 \n");
printf("\t\t~>~>~>~>~>~>~>~>~>~>~>~>~>>~>~>~>~>~ \n");
printf("\t\t~>~>~>~>>~>~>~>~>~>~>~>~>~>~>~>~>~>~ \n");
scanf("%d",&choice);
}
else
{
int worker_menu(char signup(struct regis));
}
fclose(cni);
/* And illegal use of else without matching if here?*/
}
else
{
printf("an error occured. please try again\n");
system("pause");
system("cls");
char log,reg; desion(reg, log);
}
}
에 대한
1>c:\users\kevin\documents\visual studio 2010\projects\movie\movie\p2 project.cpp(57): error C2143: syntax error : missing ';' before '{'
1>c:\users\kevin\documents\visual studio 2010\projects\movie\movie\p2 project.cpp(68): error C2181: illegal else without matching if
내가 컴파일러 그래서 이러한 충격과 당혹 신비 결과 스킵하는 오류 코멘트 전에 오류가 있습니까?
아마도 함수 앞에 닫기 중괄호 또는 괄호 *를 잊어 버렸을 것입니다. 컴파일러가 더 이상 블록의 일부가 될 수없는 것을 가로 질러 올 때까지 함수는 그 블록의 일부가됩니다. 일치하는 중괄호/괄호 강조 표시가있는 편집기를 사용합니까? – Evert
붙여 넣은 코드를 다시 포맷하려고했는데 @Evert가 맞으므로 두 번째 주석이 블록 끝에있는 줄에있는 것처럼 보입니다. –
나는 무슨 뜻인지 알지 못합니다. –