The main ()
{
The int type.
Double op2;
Char s [MAXOP];
While ((type=getop (s)). EOF)={
The switch (type) {
The case NUMBER:
Push (atof (s));
break;
Case: '+'
Push (pop () + pop ());
break;
Case: '*'
Push (pop () * pop ());
break;
In case the '-' :
Op2=pop ();
Push (pop () - op2);
break;
Case '/' :
Op2=pop ();
If (op2!=0.0)
Push (pop ()/op2);
The else
Printf (" error: zero divisor \ n ");
break;
Case '\ n' :
Printf (" \ n \ t %. 8 g ", pop ());
break;
Default:
Printf (" error: unknown command % s \ n ", s);
break;
}
}
return 0;
}
Prompt is switch statement of the first case "case NUMBER:" there are two mistakes
The error C2143: syntax errors: lack of ":" (the ";" In front of)
Error C2143: syntax errors: lack of ";" (in front of the ":"),
But why there are no errors when put in a file?
CodePudding user response:
Include the header file? Or when moving the character or what wrong...