I don’t understand what my error is:
void main(char string[])
{
strcpy(command_E,string);
processCMD(); /*FIRST ERROR: prototype function declaration not in scope */
}
void processCMD(void) /*SECOND ERROR: external item attribute mismatch */
{
.... /*rest of code not displayed*/
At the point where you use
processCMD(), you haven’t declared a prototype for it, so it gets a default one.The fact that you haven’t declared it causes the first error.
The fact that your actual definition conflicts with the default one created because you hadn’t declared it is the cause of your second error.
The solution is to either define the function before use:
or provide a prototype before use:
As to the declaration of
main, the two canonical forms are:Others are allowed by the standard (implementation defined) but those two are required (at least for hosted implementations – freestanding implementations like embedded systems or operating systems can pretty well do whatever they want).