473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Big Deal with returning int

Min
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
2 1855
"Dill Hole" <di******@microsoft.com> wrote in message
news:sd********************************@4ax.com...
On Sun, 29 Jun 2003 13:59:15 +0200, Rolf Magnus <ra******@t-online.de>
wrote:
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++
abilities?


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?

Cheers,

Stuart.
Jul 19 '05 #2

Andre Kostur wrote:
[...]
POSIX.1 is a platform/implementation specific library,
http://msdn.microsoft.com/archive/de...msdn_posix.asp

<quote>

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 ....

</quote>
and thus is off-topic for this newsgroup.


Nothing is off-topic here, darling.

regards,
alexander.
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: mjm | last post by:
Folks, Stroustrup indicates that returning by value can be faster than returning by reference but gives no details as to the size of the returned object up to which this holds. My question is...
8
by: Derek | last post by:
Some authors advocate returning const objects: const Point operator+(const Point&, const Point&); ^^^^^ Returning a const object prevents some bad code from compiling: Point a, b, c; (a +...
10
by: Fraser Ross | last post by:
I need to know the syntax for writing a reference of an array. I haven't seen it done often. I have a class with a member array and I want a member function to return an reference to it. ...
7
by: wonderboy | last post by:
Hey guys, I have a simple question. Suppose we have the following functions:- //-----My code starts here char* f1(char* s) { char* temp="Hi"; return temp;
17
by: I.M. !Knuth | last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until I started goofing around with this: ...
48
by: Frederick Gotham | last post by:
The "toupper" function takes an int as an argument. That's not too irrational given that a character literal is of type "int" in C. (Although why it isn't of type "char" escapes me... ) The...
6
by: EvilOldGit | last post by:
const Thing &operator++(int) { Thing temp = *this; operator++(); return temp; } Is this code robust ? I get a compiler warning about returning a reference to a a local, which I guess is...
89
by: Tubular Technician | last post by:
Hello, World! Reading this group for some time I came to the conclusion that people here are split into several fractions regarding size_t, including, but not limited to, * size_t is the...
23
by: pauldepstein | last post by:
Below is posted from a link for Stanford students in computer science. QUOTE BEGINS HERE Because of the risk of misuse, some experts recommend never returning a reference from a function or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.