Re: Big Deal with returning int

Discussion in 'C++' started by Ian, Jun 29, 2003.

  1. Ian

    Ian Guest

    John Harrison wrote:
    > "Min" <> wrote in message
    > news:VgvLa.341602$...
    >
    >>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 ?

    >
    >
    > I really have no idea. As you say it is pointed out time and time again
    > here, but no-one seems to be able to explain why. You'd think that with the
    > frequencey that this is pointed out, someone would also supply an
    > explaination.
    >

    If nothing is returned, how can what ever called the program tell if it
    exited with or without error?

    > Furthermore even though main must be declared to return an int, you don't
    > actually have to return one! Its the only function that gets this special
    > treatment. To me its bizarre, and since I have never seen an explaination I
    > assume its has none.
    >


    Maybe so as not to break legacy code, a bit of a lame excuse.

    Ian
    Ian, Jun 29, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Harrison

    Re: Big Deal with returning int

    John Harrison, Jun 29, 2003, in forum: C++
    Replies:
    5
    Views:
    831
    Karl Heinz Buchegger
    Jun 30, 2003
  2. Kelsey Bjarnason

    Re: Big Deal with returning int

    Kelsey Bjarnason, Jun 29, 2003, in forum: C++
    Replies:
    38
    Views:
    1,638
    Andre Kostur
    Jul 1, 2003
  3. Rolf Magnus

    Re: Big Deal with returning int

    Rolf Magnus, Jun 29, 2003, in forum: C++
    Replies:
    0
    Views:
    637
    Rolf Magnus
    Jun 29, 2003
  4. Samuele Armondi

    Re: Big Deal with returning int

    Samuele Armondi, Jun 29, 2003, in forum: C++
    Replies:
    0
    Views:
    696
    Samuele Armondi
    Jun 29, 2003
  5. Jonathan Clements

    Re: Big Deal with returning int

    Jonathan Clements, Jun 29, 2003, in forum: C++
    Replies:
    7
    Views:
    1,671
    Rolf Magnus
    Jul 1, 2003
Loading...

Share This Page