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...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Learn Hadoop and Big Data
Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...
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