r/ProgrammerDadJokes • u/danielsoft1 • 20d ago
why is the function main() in C/C++ sad?
no other function calls her...
58
Upvotes
r/ProgrammerDadJokes • u/danielsoft1 • 20d ago
no other function calls her...
34
u/maelstrom071 20d ago
Actually, __libc_start_main calls her!
12
u/RailRuler 20d ago
https://stackoverflow.com/questions/4238179/calling-main-in-main-in-c
8
u/woodardj 20d ago
Probably because she keeps
returning to stare into thevoid;7
u/tcpukl 20d ago
She's the only function definitely called.
5
u/Snippodappel 20d ago
She’s only called once 😢
2
u/Some-Passenger4219 20d ago
Ah. Not because she's void, then.
1
u/DutchOfBurdock 20d ago
Unless you're a deviant with undefined behaviour.
1
u/RimuDelph 19d ago
don't get me _start-ed
1
u/paulwillyjean 17d ago
Sigh… to me, the funniest thing is that you gave “function” the right gender to make the joke work in French too.
1
u/artyhedgehog 20d ago
In the Java world that would make it public, static and void 🫥
-4
u/un_blob 20d ago
Well, technicaly, main is called during compilation...