@cm0002 to Programmer [email protected] • 8 hours agounsafeCodelemmy.mlimagemessage-square9arrow-up1158arrow-down18cross-posted to: [email protected]
arrow-up1150arrow-down1imageunsafeCodelemmy.ml@cm0002 to Programmer [email protected] • 8 hours agomessage-square9cross-posted to: [email protected]
minus-square@[email protected]linkfedilink19•7 hours agoNot needed, main in C++ implicitly returns 0 if there is no return
minus-squareLucy :3linkfedilink3•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-square@[email protected]linkfedilink17•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.