Home
Sign Up
Sign In
V2EX
›
问与答
能夠在 c++裡呼叫 main()?
maple3142
·
Oct 31, 2016
· 2414 views
This topic created in 3660 days ago, the information mentioned may be changed or developed.
int main(){
//一些代碼
return main();
}
c++能夠這樣呼叫嗎?
main
能夠
呼叫
代碼
1 replies
amaranthf
Oct 31, 2016
1
可以,不过如果“一些代码”没有其他的退出条件的话,这个程序将无限循环,同时如果编译器没有进行尾递归优化的,这个无限循环将在执行一定次数之后造成栈溢出崩溃。
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
1748 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 03:54
·
PVG 11:54
·
LAX 19:54
·
JFK 22:54
♥ Do have faith in what you're doing.
❯