Learn C Language from the Best Tutors
Search in
In the C programming language, void main()
is not a valid signature for the main function. The correct signature for the main()
function in C is either int main()
or int main(int argc, char *argv[])
.
The main()
function serves as the entry point of a C program. It is where the execution of the program begins. The int
return type indicates that the main()
function should return an integer value to the operating system upon completion. By convention, a return value of 0 typically indicates successful execution, while a non-zero value indicates an error or abnormal termination.
Here's a brief explanation of the correct signatures:
int main()
: This signature is used when your program doesn't require any command-line arguments. The absence of parameters means that the program doesn't receive any arguments from the command line.
int main(int argc, char *argv[])
: This signature is used when your program needs to accept command-line arguments. The argc
parameter represents the count of command-line arguments passed to the program, and argv[]
is an array of strings containing those arguments.
View 2 more Answers
Related Questions
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
Brilliant Academy, a reputed B. Tech Tuition...
Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...
Lasya Infotech: An educational Training...
Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...
Make a Career as a BPO Professional
Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...
Learn Microsoft Excel
Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...
Looking for C Language Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for C Language Classes are on UrbanPro
The best Tutors for C Language Classes are on UrbanPro