Exit please
-
I'm probably just being unfair to a newbie. But I found this question from a C forum to be very funny:
when we use exit() function, do we use 0 or 1 ??. Both exits the function..
-
did you answer with the following:
You use 0 except for when you use 1, because 1 is an exception, as are any other numbers.
-
Just use abort() and be happy, dude!
-
Except for the punctuation and capitalization, there's nothing wrong with that question (except that google has the answer readily available). The answer isn't obvious - the whole idea of using a number to indicate a program-specific error is probably the only WTF here ;-)
-
Pfft. Real Programmers(tm) just kill(getpid(), SIGKILL);
-
@ahnfelt said:
Except for the punctuation and capitalization, there's nothing wrong with that question (except that google has the answer readily available). The answer isn't obvious - the whole idea of using a number to indicate a program-specific error is probably the only WTF here ;-)
The question phrasing seems to indicate he thought exit() exits a function (ie, in place of a return statement), though I'd have thought he'd notice very quickly that it does a bit more than that.
-
For the curious / bored, here's the post in question...
-
@Kemp said:
@ahnfelt said:
Except for the punctuation and capitalization, there's nothing wrong with that question (except that google has the answer readily available). The answer isn't obvious - the whole idea of using a number to indicate a program-specific error is probably the only WTF here ;-)
The question phrasing seems to indicate he thought exit() exits a function (ie, in place of a return statement), though I'd have thought he'd notice very quickly that it does a bit more than that.
I don't think so. For a return statement, the meaning of the parameter would be obvious.
-
@RoadGrader said:
For the curious / bored, here's the post in question...
You your be ashamed to quote expert-exchange. It is indeed full of newbie questions and strange answer, that you can only read by deactivating css (or paying, but who would pay for that?)
-
@tchize said:
that you can only read by deactivating css (or paying, but who would pay for that?)
Or scrolling down.
-
@Zecc said:
@tchize said:
that you can only read by deactivating css (or paying, but who would pay for that?)
Or scrolling down.
Wow, so right....
a) I can't believe I never noticed that.
b) I don't get why they even bother trying to hide the solution up top.
-
@Zecc said:
@tchize said:
that you can only read by deactivating css (or paying, but who would pay for that?)
Or scrolling down.
Dude.
-
@dhromed said:
@Zecc said:
@tchize said:
that you can only read by deactivating css (or paying, but who would pay for that?)
Or scrolling down.
Dude.
Yes, it is indeed a WTF.
-
@Zecc said:
@tchize said:
that you can only read by deactivating css (or paying, but who would pay for that?)
Or scrolling down.
I still think this is one of the funniest things I've seen, and a huge WTF. Shows the high regard they have for their users.
-
@Spectre said:
Just use abort() and be happy, dude!
As a pro-fork()er, I must say I am shocked by this display of coldness. You probably kill -9, too, and have reaper threads to deal with children! Shame on you and your methods!
-
@halcyon said:
@Spectre said:
Just use abort() and be happy, dude!
As a pro-fork()er, I must say I am shocked by this display of coldness. You probably kill -9, too, and have reaper threads to deal with children! Shame on you and your methods!
reaper threads, rofl
-
Hmm.
void exit(int parm)
{
parm/=0;
}I wonder if anyone's ever implemented it that way?