Thread: Public Apoligy

  1. #1
    Registered User Joe100's Avatar
    Join Date
    Jul 2003
    Posts
    63

    Public Apoligy

    Im sorry for my last posts it got kind of out of control.Next time i'll try and have a better attitude and i will use code tags. By the way if u dont mind telling me why u return 0 in int main instead of some other number.


    so lets start off a new level

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    I haven't been around lately, for the past couple weeks, so I don't know what happened in your previous threads, and I don't feel like searching..

    I'll take it this is a sincere public apology.

    With that said, to answer your question, return 0; is not needed at the end of main; however, it is good practice to type it in, and if not placed will be returned by the program. it means successful execution.

  3. #3
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    you return 0; for sucess, or return (somethingotherthanzero) for failure. Just...convention.
    Away.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by blackrat364
    you return 0; for sucess, or return (somethingotherthanzero) for failure. Just...convention.
    Being picky... it's not "somethingotherthanzero" according to the standard. Your statement assumes that a return of 9999 might be valid, which in a lot of cases it won't be.
    Code:
    control is returned to the host environment. If status is zero or EXIT_SUCCESS, an
    implementation defined form of the status successful termination is returned. 
    If status is EXIT_FAILURE, an implementation defined form of 
    the status unsuccessful termination is returned.
    Otherwise the status returned is implementation defined.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading Process Memory
    By polydegmon in forum C# Programming
    Replies: 0
    Last Post: 05-26-2009, 07:18 AM
  2. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  3. Linking problems in Visual Studio
    By h3ro in forum C++ Programming
    Replies: 5
    Last Post: 03-04-2008, 02:39 PM
  4. Stuck with Structs...
    By DanFraser in forum C# Programming
    Replies: 8
    Last Post: 05-03-2007, 09:55 AM
  5. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM