Question:

Why we use void in void main() in c/c program

by  |  earlier

0 LIKES UnLike

Why we use void in void main() in c/c program

 Tags:

   Report

2 ANSWERS


  1. void specifies that the function doesn't return a value. This video can explain it to you:

    http://xoax.net/comp/cpp/console/Lesson1...


  2. When you run a C program, main() is the fixed predetermined entry point of the program. If you have no main(), then how will the runtime environment know where you want it to start running your program. main() is predetermined to be the starting point, by convention. Since this is the entry point, it will not return any value to the invoking environment. The word void here identifies that the main function has no return value, as required by this same convention.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions