please explain the problem .... :)

Discussion in 'C' started by sirajul_islam_anik, Jan 12, 2012.

  1. sirajul_islam_anik

    sirajul_islam_anik New Member

    Joined:
    Jan 12, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    main()
    int main()
    void main()
    main(void)
    void main(void)
    int main(void)
    int main(data_type a,data_type b)

    as i know
    1:main().. has no parameter.. but it means int main() as default.. and returns something to OS..
    2.int main().. has no parameter ... returns something to OS.. but declaring as int main(int argc, char *argv[]) takes two parameters.. but returns something to OS
    3. void main().. has no parameter.. but will not return something as return data type is void..
    4.main(void). as same as main() returns something but takes no argument but will never receive any parameter..
    5. int main(void) and void main(void) is as same as int main() and void main() but difference is takes no argument but first one returns something to os bt 2nd one doesnt;
    6.int main(data_type a,data_type b) returns something to os and take arguments as declared..

    Now my ques is that.. am i right in these things i said above?
    there is a confusion that.. declaring int main(void) does not need to use return statement at the end of the program.. some1 said me that using void in first braces means it will not return something.. pls explain..
    and thank u in advance.. :)
     
  2. hobbyist

    hobbyist New Member

    Joined:
    Jan 7, 2012
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    0
    mill over http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?id=1043284376&answer=1044841143 for a detailed explanation. copy the link in red into your web browser.

    HTH
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice