1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Use of int, return, and void

Discussion in 'C' started by imported_chichi, Aug 24, 2011.

Thread Status:
Not open for further replies.
  1. imported_chichi

    imported_chichi New Member

    Joined:
    Aug 23, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    I am new to C programming and I would like the following clarified

    int main ()

    {
    printf("Hello World!");

    return 0;

    }

    Why is the int used before main when the function does not return an integer but a string?
    Why is return 0; used when function prints a string to the output?
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    1
    Trophy Points:
    0
    You already had this thread once here and this is not your introduction and so I moved to C Programming and so make sure you create the thread once and possibly in the right forum.
     
Thread Status:
Not open for further replies.

Share This Page