Thread: void main()

  1. #16
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Use void main and i will come to your house with a dull spoon and castrate you. If that isnt bad enough, im bringing govtcheez and -ken- with me.

  2. #17
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Why do people kill, rape, and steal? Why don't we all just get along in peace? Why do authors write void main()?

    The answer is simple: people are idiots. If an author doesn't know how to properly define main(), I wouldn't trust him about a darn thing. Get yourself a better book is my advice.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #18
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    >Use void main and i will come to your house with a dull spoon and castrate you. If that isnt bad enough, im bringing govtcheez and -ken- with me.

    Yikes, now that would be scary.

    Who's that author that always gets the "not recommended" rating from that academic computing org? You know the one that comes out with like 5 books a year. I wonder if he uses void main()?

  4. #19
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    Originally posted by swoopy
    >Use void main and i will come to your house with a dull spoon and castrate you. If that isnt bad enough, im bringing govtcheez and -ken- with me.

    Yikes, now that would be scary.

    Who's that author that always gets the "not recommended" rating from that academic computing org? You know the one that comes out with like 5 books a year. I wonder if he uses void main()?
    Yes he does and no he doesn't:
    Code:
    ##  You are therefore free to declare main() as required by your
    ##  program.
    This statement is immediately followed by the example:
    void main (void)

    even though the text of the standard directly opposite states that this is undefined. Indeed, the text I quote makes me wonder whether Schildt believes that:
    struct foo { int i; double d; } main (double argc, struct foo argv)

    is permitted !
    Most of the examples in the book declare main() as void. I won't bother to point them out individually.

    Obtained from:
    http://www.lysator.liu.se/c/schildt.html

    But later he states:

    Code:
    ##  Though most compilers will automatically return 0 when no other
    ##  return value is specified (even when main() is declared as
    ##  void), you should not rely on this fact because it is not
    ##  guaranteed by the standard.
    Indeed it is not. If main() is declared as void, I don't know of any compiler that will return 0. Indeed, the standard forbids it to !
    Last edited by Lynux-Penguin; 07-12-2003 at 06:45 PM.
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

  5. #20
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Guys its easy, void main is NOT and NEVER WILL BE C++!!!! PERIOD!

  6. #21
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    So complex...
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  7. #22
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    I second that


  8. #23
    Registered User
    Join Date
    Jul 2003
    Posts
    3
    pick

    c how to program
    by deitel& deitel

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. can someone help me with these errors please code included
    By geekrockergal in forum C Programming
    Replies: 7
    Last Post: 02-10-2009, 02:20 PM
  3. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  4. need help with handelling multiple source files
    By DarkMortar in forum C++ Programming
    Replies: 38
    Last Post: 05-26-2006, 10:46 PM
  5. getting a headache
    By sreetvert83 in forum C++ Programming
    Replies: 41
    Last Post: 09-30-2005, 05:20 AM