Error: undefined reference to 'main' in C
The error: undefined reference to 'main' in C program is a very stupid mistake by the programmer, it occurs when the main() function does not exist in the program. If you used main() function and still the error is there, you must check the spelling of the main() function.
Consider the given example, here I wrote mian() instead of main(), see the spelling of main() which is not correct in the program.
Example:
Output
How to fix?
To fix this error, correct the spelling of the main() function.
Correct code:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer