Re: Big Deal with returning int

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

  1. "Julián Albo" <> wrote in message
    news:...
    Samuele Armondi escribió:

    > systems. Obviously, most compilers will be smart enough to substitute int
    > main() for void main() and add a return 0; to the end of it, but it

    defeats
    > the purpose of returning a value at all, does it not?


    The compilers i use in ms-dos (time ago) does not add a return 0. void
    main is called just like int main, and the value returned is whatever is
    in the ax register.

    Regards.

    Even more reason to use int main(). "whatever is in the ax register" does
    not give the OS any information as to whether or not the code was
    successful.
    S. Armondi
     
    Samuele Armondi, 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. Ian
    Replies:
    0
    Views:
    677
  2. John Harrison

    Re: Big Deal with returning int

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

    Re: Big Deal with returning int

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

    Re: Big Deal with returning int

    Rolf Magnus, Jun 29, 2003, in forum: C++
    Replies:
    0
    Views:
    658
    Rolf Magnus
    Jun 29, 2003
  5. Jonathan Clements

    Re: Big Deal with returning int

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

Share This Page