linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Glynn Clements <glynn@gclements.plus.com>
To: Steve Graegert <graegerts@gmail.com>
Cc: Ankit Jain <ankitjain1580@yahoo.com>,
	linux-c-programming@vger.kernel.org
Subject: Re: variable length function
Date: Wed, 15 Jun 2005 03:23:55 +0100	[thread overview]
Message-ID: <17071.37179.269117.890201@gargle.gargle.HOWL> (raw)
In-Reply-To: <6a00c8d505061412142f93e234@mail.gmail.com>


Steve Graegert wrote:

> > also, if what is the default return type and value of
> > main function in C in gcc, ansi C and turbo C?

> Question 4:
> ISO C99 suggests the return type of main() to be of type int.  There
> is a never ending debate among some professionals whether void is
> equally legal.  Some compilers behave like ANSI C that allows
> declaration of type void but return int implicitly.  In other words:
> stick to int.

The value returned from main is used as the process' exit code. If you
declare main() as returning void, and return from it, the process is
likely to have a random exit code (e.g. whatever happens to be in the
EAX register upon return from main()).

-- 
Glynn Clements <glynn@gclements.plus.com>

  reply	other threads:[~2005-06-15  2:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-14 17:43 variable length function Ankit Jain
2005-06-14 19:14 ` Steve Graegert
2005-06-15  2:23   ` Glynn Clements [this message]
2005-06-15  6:33     ` Steve Graegert
2005-06-15  8:36       ` Ankit Jain
2005-06-15  9:08         ` Steve Graegert
2005-06-15 11:33         ` Glynn Clements
2005-06-15 15:59           ` Ankit Jain
2005-06-15 16:26             ` Steve Graegert
2005-06-15 17:22               ` Ron Michael Khu
2005-06-16  2:31           ` Rajkumar Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17071.37179.269117.890201@gargle.gargle.HOWL \
    --to=glynn@gclements.plus.com \
    --cc=ankitjain1580@yahoo.com \
    --cc=graegerts@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).