程序执行的起点 [英] Start point of execution of a program

查看:93
本文介绍了程序执行的起点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我知道main()函数是C ++

程序中的执行起点。

如果一个对象在main()之前的全局空间中?

在哪个类对象的构造函数中调用?在main()之前或之后

main()?


Subrat @ Bangalore

解决方案

subrat写道:


你好,

我知道main()函数是C ++中执行的起点

程序。

如果对象在main()之前位于全局空间中怎么办?

类对象的构造函数在哪里调用?在main()之前或之后

main()?



之前,它在main之后被调用,它没有多大用处因为

申请已经终止了!


-

Ian Collins。


在main()之前。

subrat写道:


你好,

我知道main()函数是C ++

程序中的执行起点。

如果一个对象在main()之前位于全局空间中怎么办?

类对象的构造函数在哪里调用?在main()之前或之后

main()?


Subrat @ Bangalore


< blockquote>你能给出一个例子吗?

我无法理解它?

<是******** @ gmail.comwrote in message

新闻:11 ********************* @ i3g2000cwc.googlegrou ps.com ...


在main()之前。

subrat写道:


你好,

我知道main()函数是
中的执行起点



C ++

< blockquote class =post_quotes>
program。

如果一个对象在main()之前位于全局空间中怎么办?

这个类的构造函数在哪里对象叫?在
之后的main()或



之前


main()?

Subrat @ Bangalore



Hello,
I know that the main( ) function is the starting point of execution in a C++
program.
What if an object is in the global space before main()?
Where is the constructor of the class object called? Before main() or after
main()?

Subrat@Bangalore

解决方案

subrat wrote:

Hello,
I know that the main( ) function is the starting point of execution in a C++
program.
What if an object is in the global space before main()?
Where is the constructor of the class object called? Before main() or after
main()?

Before, it were called after main, it wouldn''t be much use as the
application would have terminated!

--
Ian Collins.


Before main().
subrat wrote:

Hello,
I know that the main( ) function is the starting point of execution in a C++
program.
What if an object is in the global space before main()?
Where is the constructor of the class object called? Before main() or after
main()?

Subrat@Bangalore


Can u give an example?
I am not able to figure it out?
<Is********@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...

Before main().
subrat wrote:

Hello,
I know that the main( ) function is the starting point of execution in a

C++

program.
What if an object is in the global space before main()?
Where is the constructor of the class object called? Before main() or

after

main()?

Subrat@Bangalore



这篇关于程序执行的起点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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