Thread: c programme

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1

    Thumbs up c programme

    I have one doubt about the main function. As per the function
    rule every function returns a value either what ever the value may be either it will be a value or a NULL value. what about the
    main function. what it returns how it returns and where it returns.

    I have not cleared with the doubt. please help me.

    thanks for helping me.

  2. #2
    free(me);
    Join Date
    Oct 2001
    Location
    Santo Domingo, DN, Dominican Republic
    Posts
    98

    ...

    As far as i know the function main() should return the status of it's termination to the OS, that is to say whether it failed or succeeded in doing what it set out to do. 0 being success and any non-zero number being failure, it's common to use 1 for this purpose.

    I personally use main() as follows:

    Code:
    int main(void)
    {
        /* source code */
        return 0;
    }
    adios,
    biterman.
    Do you know how contemptous they are of you?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Closing a programme with cin.get
    By Dontgiveup in forum C++ Programming
    Replies: 2
    Last Post: 03-14-2009, 02:35 PM
  2. How to view the programme before it disappears
    By yousuf in forum C Programming
    Replies: 2
    Last Post: 03-22-2008, 08:12 AM
  3. Replies: 3
    Last Post: 05-13-2007, 08:55 AM
  4. Gui Programme does'nt Compiles from DOS
    By Shadowhunt in forum C++ Programming
    Replies: 1
    Last Post: 06-06-2003, 08:05 AM
  5. Simple C++ GUI programme does'nt run from dos
    By Shadowhunt in forum C++ Programming
    Replies: 4
    Last Post: 05-31-2003, 05:30 AM