I just had to...
Printable View
I just had to...
Who voted void? And have they been members for more than .21 nanoseconds?
-Prelude
10 to 1 a newbie.Quote:
Who voted void?
I VOTE INT MAIN!!!!! (the only way to go):p
Code:std::pair<int,void> main()
{
}
hehe, i couldn't help it
My answer: Check in Salemīs Avatar!!!
My answer: either way you return int. void just makes the returned value undefined.
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. :D
-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.)
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!
Don't forget goto.
Curse me for a fool! I completely forgot about "goto"!
Good one, golfinguy4! :)
-Skipper
void main? goto? *sigh* when will you guys learn that longjmp is the only way to fly :D :D
How come this wasnt closed already?
What about:
main()
Is that acceptable? or should it be int main()?
the 2 people who voted for void main better watch out when prelude comes along...
>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.
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. :DQuote:
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!
-Prelude
>> just looking at that source would make your eyes bleed
mmmm gotta looove that eye-bleeding feeling ... :D
Whahahah I voted for void!!! On a side note, on the Game boy advance the c entry point into a program is void main() so it isn't always the evil plague that some would lead you to believe (like Salem for instance).
That aside I did vote "void main" to be an ass. int main is actually standard.
I am curious to see what you mean, post it!
I voted int main( ), last time I wrote code with void main() I received a proper telling off from prelude! It just wasn't worth the risk :D
how the hell did this trhead get over 100,000 votes???
*takes a break from creating new accounts to vote 'this thread is stupid'*
whew, this is hard work guys. any help? a few more and we can hit the 5 million mark!
Quote:
Originally posted by Waldo2k2
how the hell did this trhead get over 100,000 votes???
Methinks a mod may have been been busy.
At least it didnt get deleted.:)
:) Who voted for "this thread is stupid"?
i can take credit for the extra 3 '9's on the end
Yes that is exactly right. I'm not advocating the use of void main(). Also, like any other device that doesn't use an operating system, I could make the c entry point int main(). Like the link says "...freestanding implementations are comparatively rare, and if you're using one, you probably know it" so all newbies completely disreguard my mensions of void main.Quote:
Originally posted by Salem
> on the Game boy advance the c entry point into a program is void main()
But that's a freestanding implementation
See http://www.eskimo.com/~scs/C-faq/q11.12.html
And before you get all high about how it isn't a real world problem - forget it
There is one real implementation where void main is provably wrong and fatal
http://users.aber.ac.uk/auj/voidmain.shtml
NO offense to anyone but void main is for idiots who cant remember or are just to lazy to write return 0; or return whatever. if you use void main then go use another function.
I have a better idea. Instead of returning 0, simply return five thousand eight hundred and sixty two trilion multiplied by the multiplicative inverse of pi, divided by the area of a cone with a base area of 16 and a height of 20 billion added to the instantaneous 'velocity' of cheese being pulled into the gravitational pull of the eart, all to the 0 power, minus 1
EDIT:
That exhausts my math knowledge, and I don't even seem cool now that i think of it.
>NO offense to anyone but void main is for idiots who cant remember or are just to lazy to write return 0; or return whatever.
Especially since standard C++ returns 0 by default if main is defined as returning int and the return statement is omitted. Some arguments are that it's quicker to void main, but with standard C++ you have to type a whole extra character. So much for that argument. :D
-Prelude
I think that is the ANSI want it to me int main() just make int main() ... it's that simple :D
Wouldn't it just depend on your rogram? wheather u want main() to return a value or not.
>Wouldn't it just depend on your rogram? wheather u want main() to return a value or not.
If you don't want to return a value then use the default of 0. But main must return an int (unless it's a freestanding implementation, but we've already established that if you aren't sure, you aren't freestanding).
-Prelude
Newbies with old programming books... not covering standard c++ will surely... love. void main() but one who even visited this board frequently will surely be familier with Salem's Avatar. :)
Heh well, here's a link to Salem's avatar:
Avatar
What does the operating system do when it receives a return value other than zero? I.e. what would it do differently if it had received a zero from the terminating program.
public static void ... wait, wrong board.
You BEAN! ;)Quote:
Originally posted by beege31337
public static void ... wait, wrong board.
i believe game boy advance is a freestanding implementation, yes?Quote:
Originally posted by master5001
Whahahah I voted for void!!! On a side note, on the Game boy advance the c entry point into a program is void main() so it isn't always the evil plague that some would lead you to believe (like Salem for instance).
That aside I did vote "void main" to be an ass. int main is actually standard.
Think really, really hard.Quote:
Originally posted by Waldo2k2
how the hell did this trhead get over 100,000 votes???