Question:How many main() in one C program is possible?
Answer:(a)Exactly one or (b)More than one
If answer is b than write easiest program having two main()s...
Utsav Chokshi 0 Newbie Poster
Recommended Answers
Jump to PostHave you tried typing in multiple versions and trying to compile them?
That would be the most direct way to figure out what you can and can not do...
Jump to Postmain() is the point that the program jumps to when it starts running. It's like the starting line of a race.
While some races are handicapped and have more than one starting point, the computer is not so inclined.;)
As L7Sqr mentions above, there is nothing like a …
Jump to PostSorry, you are all wrong. You may have as many mains as you want, provided they are all static (except one, of course). I am not even talking about dll tricks.
> there is nothing like a good test
Not for the questions like this. Language is defined …
Jump to Post>> Yes, I am well aware that this is the C forum, not C++. I don't have a copy of the C standards but I'm certain it contains the same or similar verbage.
> It does not
PS: This is the it.
All 13 Replies
shauzi158 -4 Newbie Poster
shauzi158 -4 Newbie Poster
L7Sqr 227 Practically a Master Poster
Adak 419 Nearly a Posting Virtuoso
nezachem 616 Practically a Posting Shark
Narue 5,707 Bad Cop Team Colleague
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Dexxta27 14 Junior Poster in Training
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
nezachem 616 Practically a Posting Shark
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
nezachem 616 Practically a Posting Shark
nezachem 616 Practically a Posting Shark
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.