Anonymous

In C Language Is Main() Function Library Or Userdefind ?

3 Answers

John Wright Profile
John Wright answered
The main() function is always, always, user defined. It is the part of a program that makes the other functions, whether they be library functions or user defined ones, run. It is the starting point of the program.

Every program in C must have a main() function, or it simply will not run. It cannot run without one. When you enter the name of your exe file at the command line, it is the main() function which is executed. It can call other functions or other programs after it starts. The other functions which you, the programmer, create are called inside the main(), while you make reference to library functions.

Javascript, on the other hand, doesn't have a main(), it is a set of functions and the programmer either decides which one will run on loading the html page, or they are called at specific points in the html page, often in response to user interaction.

Answer Question

Anonymous