C main() function

  • main() is an identifier in the program which indicates startup point of an application.
  • main() is a user defined function with pre-implemented signature of linker.
  • Always linker will be search to starts the program from main only thats why main() should be required.
  • Without using main() function we can design the program but we cant execute because compilation can be success but execution will be failed(linker error will occurs.
  • In any applicaton only one main() should be required, if we are planning more than one main function then compiler will gives an error.
  • Generally main() function doesn’t return any values thats why return type of the main function is void.
  • void main() functions doesn’t provides any exist status back to the operating system.
  • int main() function will provides exist status back to the operating system.
Powered by k2schools