View Poll Results: int main or void main?

Voters
1000006054. You may not vote on this poll
  • int

    37 0.00%
  • void

    11 0.00%
  • this thread is stupid

    1,000,006,006 100.00%

int main or void main?

This is a discussion on int main or void main? within the C++ Programming forums, part of the General Programming Boards category; I just had to......

  1. #1
    Registered User abrege's Avatar
    Join Date
    Nov 2002
    Posts
    369

    int main or void main?

    I just had to...
    I am against the teaching of evolution in schools. I am also against widespread
    literacy and the refrigeration of food.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Who voted void? And have they been members for more than .21 nanoseconds?

    -Prelude
    My best code is written with the delete key.

  3. #3
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    Who voted void?
    10 to 1 a newbie.

    I VOTE INT MAIN!!!!! (the only way to go)

  4. #4
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Code:
    std::pair<int,void> main()
    {
    }
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  5. #5
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    hehe, i couldn't help it
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

  6. #6
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343
    My answer: Check in Salem´s Avatar!!!

  7. #7
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    My answer: either way you return int. void just makes the returned value undefined.

  8. #8
    Registered User
    Join Date
    Apr 2002
    Posts
    362
    Prelude,

    >Who voted void? And have they been members for more than .21 nanoseconds?

    300 gazillion posts, or something like that, and you can still sense the "void main()" question. It's a gift, I swear.

    -Skipper

    P.S. to ygfperson: Exactly! And, it's the "undefined" part that should scare the whoopie out of folks. (Hope I didn't offend anyone.)
    "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow

  9. #9
    Shadow12345
    Guest
    void main is the best. I love void main. In fact if I use int main I get stomach aches and begin to vomint. I also use tons of global variables, magic numbers, I fail to include comments, I use goto statements, and I consistently have loops that iterate thousands of times sending copies of large data structures into functions without using pointers!
    Last edited by Shadow12345; 11-14-2002 at 06:19 PM.

  10. #10
    ˇAmo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Don't forget goto.

  11. #11
    Registered User
    Join Date
    Apr 2002
    Posts
    362
    Curse me for a fool! I completely forgot about "goto"!

    Good one, golfinguy4!

    -Skipper
    "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow

  12. #12
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    void main? goto? *sigh* when will you guys learn that longjmp is the only way to fly
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  13. #13
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198
    How come this wasnt closed already?

    What about:

    main()


    Is that acceptable? or should it be int main()?
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

  14. #14
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    the 2 people who voted for void main better watch out when prelude comes along...

  15. #15
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Is that acceptable? or should it be int main()?
    Not in C++ it isn't.

    >better watch out when prelude comes along...
    I have to know who they are to dole out punishment accordingly.
    void main is the best. I love void main. In fact if I use int main I get stomach aches and begin to vomint. I also use tons of global variables, magic numbers, I fail to include comments, I use goto statements, and I consistently have loops that iterate thousands of times sending copies of large data structures into functions without using pointers!
    Ahem. You also forgot insane function pointers. I wrote a program one time that used only a simulated goto-like effect through the heavy use of function pointers. If I find it I'll post it, just looking at that source would make your eyes bleed.

    -Prelude
    My best code is written with the delete key.

Page 1 of 3 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  5. Quack! It doesn't work! >.<
    By *Michelle* in forum C++ Programming
    Replies: 8
    Last Post: 03-01-2003, 11:26 PM

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