先生,我想了解main(),它是用户定义的还是库函数? [英] sir i want to know about main(), it is a user defined or library function?

查看:293
本文介绍了先生,我想了解main(),它是用户定义的还是库函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道main(),这是用户定义的还是库函数?

sir i want to know about main(), it is a user defined or library function?

推荐答案

问题被提出了:"用户定义的"和""不一定是互斥的,因为库中包含的所有功能(从编译器的角度而言)都是用户定义的".
main()实际上是由位于默认库中的函数调用的,该函数在程序启动时由操作系统跳转到".

main()本身不在默认库内,因此用户"(就编译器用户"而言)必须以某种方式提供它.

他可以通过在自己的资源中编写来实现,或者通过的项目链接到某个框架库来做到这一点. b>包含它.
The question is malposed: "user defined" and "library" are not necessarily mutually exclusive, since all function contained in a library (in term of the compiler point of view) are "user defined".

main() is actually called by a function that sits in the default library that is "jumped into" by the OS at program startup.

main() itself is not inside the default library, hence the "user" (in the sense of the "compiler user") must provide it somehow.

He can do that either by writing it in one his own sources, or by linking its project to a some framework library that contains it.


[阅读它]


如果您使用Visual Studio向导创建项目,它将为您提供基础(即使您不希望这样做) ).
If you create your project using the Visual Studio Wizard it will make a main for you (even if you don''t want it to).


这篇关于先生,我想了解main(),它是用户定义的还是库函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆