468,539 Members | 1,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,539 developers. It's quick & easy.

What is the solution for error: redefinition of 'main' in C?

It gives me an error when I try to write another program on the same source file that I used for a program before. the error is error: redefinition of 'main'. What should I do?
Oct 1 '19 #1
2 1106
2,422 Expert 2GB
Most likely, your source file contains two functions named main. You can’t have two functions with the same name in the same source file.
Oct 2 '19 #2
436 Expert 256MB
Also, you may need to check the source files that are being included in the current one.
Oct 12 '19 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by James M. Luongo | last post: by
70 posts views Thread by junky_fellow | last post: by
4 posts views Thread by Protoman | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.