The error messages suggest function
main is defined twice in your source file (perhaps once on line 3 and again on line 5). However, the code snippet you provided shows only a single definition of
main. If in fact your code only defines
main once then something else is going on.
Perhaps this error is an artifact of including
<stdio.h> twice ... although doing so ought not to cause any errors.
Perhaps the error does have something to do with the name "main". The C Standard requires that the definition of
main be compatible with one of the following function prototypes:
- int main(void);
- int main();
- int main(int argc, char *argv[]);
The second of these is legal but deprecated. Perhaps your compiler warnings are set to an extremely pedantic level that doesn't like you using the deprecated form of
main.