this post was submitted on 11 Feb 2025
271 points (95.3% liked)

Programmer Humor

33320 readers
614 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] lily33@lemm.ee 40 points 18 hours ago* (last edited 18 hours ago) (2 children)

That is why I use just int main(){...} without arguments instead.

[–] Bogus5553@lemm.ee 29 points 18 hours ago* (last edited 18 hours ago) (3 children)

Any void main(){...} enjoyers?

[–] CausticFlames@sopuli.xyz 1 points 6 hours ago

int main(void) { . . . } for me!

[–] stebo02@lemmy.dbzer0.com 6 points 11 hours ago (2 children)

besides not requiring a return value, what difference does it make?

[–] barubary@infosec.exchange 4 points 10 hours ago (1 children)

@stebo02 @Bogus5553 Neither of them require a return value, but void main isn't legal C++.

[–] stebo02@lemmy.dbzer0.com 1 points 10 hours ago

yeah I thought so, does it work in C?

[–] Buddahriffic@lemmy.world 2 points 10 hours ago

It will also give an error if you try to add a return value anyways.

[–] Thorry84@feddit.nl 5 points 14 hours ago

while (true) {...}

[–] CptKrkIsClmbngThMntn@hexbear.net 5 points 13 hours ago

Very true, the less user input you have the safer your code will be.