PandaDEV@lemmy.ml to Programmer Humor@lemmy.ml · 21 hours agounsafeCodeimagemessage-square14fedilinkarrow-up1297arrow-down115
arrow-up1282arrow-down1imageunsafeCodePandaDEV@lemmy.ml to Programmer Humor@lemmy.ml · 21 hours agomessage-square14fedilink
minus-squarelily33@lemm.eelinkfedilinkarrow-up40·edit-220 hours agoThat is why I use just int main(){...} without arguments instead.
minus-squareBogus5553@lemm.eelinkfedilinkarrow-up31arrow-down2·edit-220 hours agoAny void main(){...} enjoyers?
minus-squareCausticFlames@sopuli.xyzlinkfedilinkarrow-up1·8 hours agoint main(void) { . . . } for me!
minus-squarestebo@lemmy.dbzer0.comlinkfedilinkarrow-up6·13 hours agobesides not requiring a return value, what difference does it make?
minus-squareFüsilier Breitlinger@infosec.exchangelinkfedilinkarrow-up4·12 hours ago@stebo02 @Bogus5553 Neither of them require a return value, but void main isn’t legal C++.
minus-squarestebo@lemmy.dbzer0.comlinkfedilinkarrow-up1·12 hours agoyeah I thought so, does it work in C?
minus-squareBuddahriffic@lemmy.worldlinkfedilinkarrow-up2·12 hours agoIt will also give an error if you try to add a return value anyways.
minus-squareCptKrkIsClmbngThMntn [any]@hexbear.netlinkfedilinkEnglisharrow-up6·15 hours agoVery true, the less user input you have the safer your code will be.
That is why I use just
int main(){...}
without arguments instead.Any
void main(){...}
enjoyers?int main(void) { . . . }
for me!besides not requiring a return value, what difference does it make?
@stebo02 @Bogus5553 Neither of them require a return value, but
void main
isn’t legal C++.yeah I thought so, does it work in C?
It will also give an error if you try to add a return value anyways.
while (true) {...}
Very true, the less user input you have the safer your code will be.