Thread: about main()

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    4

    about main()

    can someone please tell me the differences between: main(), int main(), and void main(void). thanks.

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    12
    The return type is different in the case of void main. void main will cause unspecified behavior because the programs ends up returning a value even if you declare a void return type so it should not be used with the global point of entry 'main'. If you do not specify the return type than the default is ínt.

  3. #3
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140
    isn't there something in the faq about that?
    i am not sure, but i think i've seen something there...

  4. #4
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why To Use int main()
    By year2038bug in forum C Programming
    Replies: 2
    Last Post: 08-19-2005, 01:28 PM
  2. passing params to main()
    By mike11 in forum C++ Programming
    Replies: 14
    Last Post: 06-21-2005, 12:36 PM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. Int Main or Void Main?
    By FromHolland in forum C++ Programming
    Replies: 9
    Last Post: 06-12-2003, 04:29 PM
  5. int main (), main (), main (void), int main (void) HELP!!!
    By SmokingMonkey in forum C++ Programming
    Replies: 7
    Last Post: 05-31-2003, 09:46 PM