TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

C++ main function doesn't need return but has int return type

3 pointsby argorain4 months ago

1 comment

argorain4 months ago
TIL C++ has exception for main function to be without return even though they forced it to have int return type. Can someone explain to me why this was done? C was happy with void return type but C++ forces int, yet implicitly adds return 0 if missing.
评论 #42863454 未加载
评论 #42862916 未加载
评论 #42862925 未加载