0
About Main function
I want to know about main function Is it user defined or predefined As we want to call a function to run it then how main function runs without calling
7 Respuestas
+ 7
@Ronak Read this 👇👇👇
http://en.cppreference.com/w/c/language/main_function
+ 3
Jamie can you explain in deep how operating system call main function
+ 2
Ronak,
The convention in the c family is that the main class is the entry point in the program.
An executable program is going to have many sections of code, you might have c, c++, assembly and others. it must have a starting address. when the c compiler sees "main" it tells the linker to use the stay off that class as the start of the program.
For example, in Linux you can use readelf to see the value of the _start symbol for an elf file.
HTH
Juan
+ 1
https://www.sololearn.com/discuss/145188/?ref=app
look this one also
+ 1
@jamie
no
0
When your program runs, the OS creat a process, and the main function is what the process doing. when the OS schedules to run the process, the main function is called.