0

How does a main() function in c++differ from main()in c?

c++

9th Nov 2017, 8:29 AM
Durgvijay Prasad
Durgvijay Prasad - avatar
1 Answer
0
In C, main() is preceded by a bit of code that sets up the stack for the C programming language’s calling conventions before jumping to the main subroutine. This represents a handful of instructions. In C++, main() is preceded a fair amount of runtime setup, calling constructors of any global variables, initializing anything that has to be there when main() starts. How much happens depends on the structure of your program.
9th Nov 2017, 12:07 PM
Shubham Sharma
Shubham Sharma - avatar