cm0002@lemmy.world to Programmer Humor@programming.dev · 8 hours agounsafeCodelemmy.mlimagemessage-square9fedilinkarrow-up1165arrow-down17cross-posted to: programmerhumor@lemmy.ml
arrow-up1158arrow-down1imageunsafeCodelemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 8 hours agomessage-square9fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareKwdglinkfedilinkarrow-up21arrow-down1·8 hours agoNot needed, main in C++ implicitly returns 0 if there is no return
minus-squareLucy :3@feddit.orglinkfedilinkarrow-up7arrow-down4·7 hours agoShould ≠ Needs to You can do it, and it will work, but it’s unclean and not best-practice. I wouldn’t be surprised if it’s undefined behaviour.
minus-squarexmunk@sh.itjust.workslinkfedilinkarrow-up17·6 hours agoJust to clarify. It is defined behavior - there’s plenty of undefined behavior in C but that ain’t one of them.
Not needed, main in C++ implicitly returns 0 if there is no return
Should ≠ Needs to
You can do it, and it will work, but it’s unclean and not best-practice. I wouldn’t be surprised if it’s undefined behaviour.
Just to clarify. It is defined behavior - there’s plenty of undefined behavior in C but that ain’t one of them.