By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,050 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,050 IT Pros & Developers. It's quick & easy.

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

P: 1
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?
2 Weeks Ago #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 2,400
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.
2 Weeks Ago #2

P: 117
Also, you may need to check the source files that are being included in the current one.
5 Days Ago #3

Post your reply

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