I'm very new to C++; can a program be started with anything other than int main
? And what, exactly, is the purpose of the main
part, anyway?
Patiodude
0
Newbie Poster
Recommended Answers
Jump to PostSome compilers have an option to rename the entry point, but I'd question its usefulness in all but the most niche cases.
And what, exactly, is the purpose of the main part, anyway?
To provide an entry point into the program. That's really it. The C++ runtime has …
Jump to PostAh, now this is a different question. In C/C++, any given program must have exactly one
…main()
function, but a program may span as many files as you like, and not all source files must have amain()
- indeed, most source files won't, for the majority of non-trivial projects.
All 6 Replies
VernonDozier
2,218
Posting Expert
Featured Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Patiodude
0
Newbie Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
Patiodude
0
Newbie Poster
VernonDozier
2,218
Posting Expert
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.