Albin Jose@suppo.fi to Programming@programming.dev · 1 year agoWhat will happen if we put a semi-colon after a for loop in C++?message-squaremessage-square13fedilinkarrow-up119arrow-down14
arrow-up115arrow-down1message-squareWhat will happen if we put a semi-colon after a for loop in C++?Albin Jose@suppo.fi to Programming@programming.dev · 1 year agomessage-square13fedilink
minus-squareJakenVeina@lemm.eelinkfedilinkarrow-up16·1 year agoThe loop will run to completion with no side effects. Unless it gets optimized away by the compiler or CPU.
minus-squarevext01@lemmy.sdf.orglinkfedilinkarrow-up12·1 year agoNow slap some commas in there and you can have side effects in the loop header. Guaranteed to confuse :)
The loop will run to completion with no side effects. Unless it gets optimized away by the compiler or CPU.
Now slap some commas in there and you can have side effects in the loop header.
Guaranteed to confuse :)