3

As the functions are of 2 type:
1.Pre-defined/library functions,
2.User defined functions.

What type of function is main() function?

This doubt comes in my mind while writing a program we define the main() function as we do the others.

Please help!!!

Harsh Kumar
  • 232
  • 2
  • 13

1 Answers1

3

Library functions are functions that somebody else coded, and are available for use.

User-defined functions are functions that the user defines. This is the case of the C/C++ main().

You can think of main() as a placeholder or hook. The user supplies it, but the standard library knows to call it after initializing itself.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514