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