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%

Thread: How evil is void main?

  1. #16
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    (I still use int main, so don't accuse me to be a voider )
    Well, as long as your not one of them voiders!!!
    The knack of flying is learning to throw yourself at the ground and miss.

  2. #17
    I, also, use int main(), but void main() doesnt seem too bad to me
    -Save the whales. Collect the whole set.

  3. #18
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    Originally posted by Magos
    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 )
    microsoft may define the return value of a void main function as zero, but that's not a standard consensus. other compilers simply ignore the return value, which may cause your operating system to suspect a problem.

  4. #19
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    void main() doesnt seem too bad to me

    NOOOOO!!!! Stay away from the light!!!!

    *Looks in fear over shoulder for Prelude *
    The knack of flying is learning to throw yourself at the ground and miss.

  5. #20
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    I always ask myself, if they say that int main() is the standart way, why don't we just stick to it?
    And why are all these threads about int/void main().
    Using void main() won't make our lifr easier.

    Note: I think in the FAQ's there is a section about that.

    By The Way, check out Salem's avatar, they are doomed

  6. #21
    Registered User abrege's Avatar
    Join Date
    Nov 2002
    Posts
    369
    void main()
    void main()
    void main()
    void main()

    Wheee void main() rocks!!
    I am against the teaching of evolution in schools. I am also against widespread
    literacy and the refrigeration of food.

  7. #22
    Funniest man in this seat minesweeper's Avatar
    Join Date
    Mar 2002
    Posts
    798
    Oh my goodness. Prelude is gonna go ballistic. We have all seen her let off steam before about void main(). Now we have a thread created solely for the purpose of debating the issue. Dig yourselves a trench fellas and take cover, this could be messy!!

  8. #23
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    Oh my goodness. Prelude is gonna go ballistic
    Yeah...Tell me about it
    The knack of flying is learning to throw yourself at the ground and miss.

  9. #24
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    You can either choose to do the right thing, and try to learn as much about the language as possible so that your programs have the most chance of working because you've learnt ANSI-C. This approach will stand you in good stead for when you have to use a new compiler (or even the next version of the one you're using now).

    Or you can choose to riddle your programs with all sorts of undefined behaviour because you've learn dialect-C, and so long as it "works for me" that's OK right. This approach will really bite you in the ass in the long run and you find that you have to unlearn all your bad habits ([yoda]you must unlearn what you have learnt if you are to learn the ways of the source[/yoda]) when you have to move to a new environment. If you are fortunate, you will decide to make a much better job of learning the language the 2nd time around.

    If you are wise, you'll make sure you try and make a decent job of it the first time round.

    So if you want to keep all your small programs private, compile them once and throw them away after they've served their immediate purpose then go ahead use all the undefined behaviour you want - its only your time you're wasting, and the rest of the world can go about its business.

    But if you want to write a large program, or work with other peoples code (and have others work with yours), and you want to avoid your fellow programmers wrath / humor / distrust, then you'll want to seek out and remove as much undefined behaviour from your programs as you can, and learn the language properly so that you don't add undefined behaviour as a matter of habit in the first place.

    Remember, void main could say a lot more about the rest of your code than you would care to admit.

    http://www.cprogramming.com/cboard/s...threadid=29141
    http://www.cprogramming.com/cboard/s...threadid=28633
    http://www.cprogramming.com/cboard/s...threadid=28311
    http://www.eskimo.com/~scs/C-faq/q11.15.html
    http://www.eskimo.com/~scs/C-faq/q11.12.html

    And just for those void main'ers who cling to - nobody looks at the exit status
    http://www.eskimo.com/~scs/C-faq/q11.14.html
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  10. #25
    Much older and wiser Fountain's Avatar
    Join Date
    Dec 2001
    Location
    Engeeeerland
    Posts
    1,158
    ([yoda]you must unlearn what you have learnt if you are to learn the ways of the source[/yoda])

    Thats funny.

    Such is life.

  11. #26
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    I think we've had enough void/int main conversations for now. If you haven't worked out what is correct by reading this thread, do a seach to find out more.

    Now please.... no more!

    <closed: any questions, pm me.>
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

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, 05:59 PM
  5. Replies: 3
    Last Post: 05-13-2007, 08:55 AM