View Poll Results: How evil is void main?

Voters
15. You may not vote on this poll
  • very very very evil, it will DESTROY you

    4 26.67%
  • very very evil, it will make your life miserable

    1 6.67%
  • very evil, it will get you in trouble

    1 6.67%
  • evil, it will screw something up

    4 26.67%
  • neutral; you can use it if you want

    1 6.67%
  • good, it is simple

    0 0%
  • very good, it is simple and easy

    0 0%
  • very very good, it is your best friend

    0 0%
  • very very very good, it will SAVE YOUR LIFE

    4 26.67%

How evil is void main?

This is a discussion on How evil is void main? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^...

  1. #1
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879

    How evil is void main?

    ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #2
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    NOOOO - EVIL!!!!!! evil I say!!!!
    The knack of flying is learning to throw yourself at the ground and miss.

  3. #3
    CodeMonkey666
    Guest
    What's wrong with void main()?

  4. #4
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    CodeMonkey666, Prelude's gonna kill you.

  5. #5
    Registered User -Xp-'s Avatar
    Join Date
    Nov 2002
    Posts
    28
    lol it wont DESTROY me, it will make me miserable though

    int main {} :P
    No I DIDN'T steal my name from Misro$ofts OS, it's pure coincidence.

    The lines around my name (-) are only there because i needed a name over the 3 character minimum letter limit

  6. #6
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    CodeMonkey666, Prelude's gonna kill you.
    Not if one of the others get to him first
    The knack of flying is learning to throw yourself at the ground and miss.

  7. #7
    Satan valar_king's Avatar
    Join Date
    Aug 2001
    Posts
    288
    Everybody needs to quit complaining* about void main(), if someone else wants to use it, let them, as long as you don't have to work with their code.


    *Editted for content by Kermi3
    -Save the whales. Collect the whole set.

  8. #8
    Registered User
    Join Date
    Jul 2002
    Posts
    161
    Void main isn't evil, it's just wrong. Anyway, any decent modern compiler ignors void main() and makes it int main() behind your back.

  9. #9
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    Void main isn't evil, it's just wrong
    Evil = Wrong

    any decent modern compiler ignors void main() and makes it int main() behind your back.
    What compiler u using?
    The knack of flying is learning to throw yourself at the ground and miss.

  10. #10
    Registered User
    Join Date
    Jul 2002
    Posts
    161
    >>Evil = Wrong
    If you want to define evil that way, I won't argue.

    Usually gcc under Linux. Most modern compilers that will accept void main() actually compile it as int main(), they just doesn't tell you that's what they're doing. Myself, I always use int main().

  11. #11
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    If you want to define evil that way, I won't argue
    That's one of the evil things I know, (void main) not defining it.

    Myself, I always use int main().
    Same here. when I started C++ and use *ahem* "void main", my instructor almost beat the living crap out of me.
    The knack of flying is learning to throw yourself at the ground and miss.

  12. #12
    Banned Cgawd's Avatar
    Join Date
    Oct 2002
    Posts
    405
    if youre a sloppy programmer, feel free to void main, but if you are professional and want to program properly, int main....bottom line. It all comes down to good habits. Just like smoking is a bad habit, sure at first it feels good and stuff, but eventually IT WILL KILL YOU.

  13. #13
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Correct me if I'm wrong, but when declaring main to return an int you can decide which exit code is returned. When declaring main to return a void (nothing) the exit code is predefined (ie: 0).

    http://msdn.microsoft.com./library/d...n_function.asp
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  14. #14
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    Correct me if I'm wrong, but when declaring main to return an int you can decide which exit code is returned. When declaring main to return a void (nothing) the exit code is predefined (ie: 0).
    True. 0 is the code for "a normal exit" - no errors
    The knack of flying is learning to throw yourself at the ground and miss.

  15. #15
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Then what's so evil about it? Ok, you cannot specify an error return code if your program fails to do some stuff, but that seems kinda minor to me...

    (I still use int main, so don't accuse me to be a voider )
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 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
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. Case Statement
    By danlee58 in forum C Programming
    Replies: 16
    Last Post: 11-23-2008, 08:46 PM
  4. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 06:59 PM
  5. Replies: 3
    Last Post: 05-13-2007, 09:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21