By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,079 Members | 940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,079 IT Pros & Developers. It's quick & easy.

Big Deal with returning int

P: n/a
I have seen so many pointing out "main" should explicitly return "int".
Beside, the language spec or committee, or some guru said so, what is a BIG
deal with it ? What difference does it make if "void main" rather than "int
main" ? It is not that some obscure code that people can't understand
easily. Anyway, would someone explain why ;? not just it is better to
return explicitly.

Or How is it possibly cause the problem ?

PS: I am saying this because most of C++ books I found, uses "void main".
If they can't get this fundamental thing right, I guess, I have been reading
all the garbage from them.
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
"Dill Hole" <di******> wrote in message
On Sun, 29 Jun 2003 13:59:15 +0200, Rolf Magnus <ra******>
I see it a bit different. If an author uses void main, that shows that
he doesn't know C++ very well. This gives not much trust in the rest of
the book.
It's quite interesting that you call "void main" common practise, since
it actually never was allowed. So you think the rule should be changed,
because nobody follows it anyway?

Misspelling "practice" shows that you do not know English very well.
If you do not have English mastered why should we trust your C++

Why exactly a command of English is necessary in order to be a competent C++
programmer escapes me. Anyway, if you're going to resort to pedantry in an
attempt to prove something, you might as well get it right. Consider your
final sentence: "If you do not have English mastered why should we trust
your C++ abilities?" Now you may consider this overly pedantic, but I'm
curious to know whether you have encountered commas in your clearly
extensive study of the English language. Of course, in "Dill Hole" English,
a peculiar dialect apparently spoken only by you, it's quite possible that,
in the final sentence above, the word "mastered" is not followed by a comma.
Unfortunately, this is not the case in the actual language. I think what I'm
saying essentially boils down to the well-known proverb, "People in
glasshouses shouldn't throw stones."

While we're engaging in the rather pointless activity of launching
"ad-hominem" attacks, might I also suggest that a course in logic would
benefit you enormously? A command of English is neither necessary nor
sufficient for a programmer. There are many extremely good programmers who
don't speak a word of English. There are also many people who speak
excellent English but would find a C++ program incomprehensible. Whilst it
is important to be able to write correctly in your native language, for
reasons largely unrelated to programming, your ability (or otherwise) to do
so is nevertheless irrelevant to your ability as a C++ programmer.

Now that that's settled, can we try and avoid "ad-hominem" attacks that add
nothing to the discussion at hand?


Jul 19 '05 #2

P: n/a

Andre Kostur wrote:
POSIX.1 is a platform/implementation specific library,


POSIX stands for Portable Operating System Interface for computing
environments. POSIX began as an effort by the IEEE community to
promote the portability of applications across UNIX(R) environments
by developing a clear, consistent, and unambiguous set of standards.
However, POSIX is not limited to the UNIX environment. It can also
be implemented on non-UNIX operating systems, as was done with the
IEEE Standard 1003.1-1990 (POSIX.1) Implementation on Virtual
Memory System (VMS), Multiprogramming Executive (MPE), and the
Conversion Technology Operating System (CTOS). POSIX actually
consists of a set of standards ....

and thus is off-topic for this newsgroup.

Nothing is off-topic here, darling.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.