470,856 Members | 2,361 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,856 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 2206
donbock
2,425 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
dev7060
575 Expert 512MB
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
By using this site, you agree to our Privacy Policy and Terms of Use.