开发者

C++ implementation

开发者 https://www.devze.com 2023-01-27 12:50 出处:网络
I\'ve read this line in a book:- \"When we ask the C++ implementation to run a program, it does s开发者_如何学运维o by calling this function.\"

I've read this line in a book:- "When we ask the C++ implementation to run a program, it does s开发者_如何学运维o by calling this function."

And I'm wondering about what "C++ implementation" means or what it specifically is. Help!?


"C++ implementation" means the compiler plus linker plus standard libraries plus the system that the program actually runs on. Everything except your source, basically.

An implementation is something that implements the C++ standard.

So the book is not saying that any particular thing calls your function. Rather, that whole bundle, or some part(s) of it, will ensure that main is called.

In practice, this means that your compiled executable contains some system-specific startup code, followed by initializers for static objects, followed by a call to your main function.


May be the c++ runtime library is the implementation in this case. The runtime library initializes static variables and does other stuff and finally calls main.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号