Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 5 months agoUnused variablessh.itjust.worksimagemessage-square45fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageUnused variablessh.itjust.worksSjmarf@sh.itjust.works to Programmer Humor@programming.dev · 5 months agomessage-square45fedilink
minus-squareRichard@lemmy.worldlinkfedilinkEnglisharrow-up0·5 months agoWhat do you mean? Variables do not necessarily need to be used, you can allocate memory for some value and initialise it but then simply don’t do anything with it.
minus-squareDacoTaco@lemmy.worldlinkfedilinkarrow-up0·5 months agoYou can but compilers will optimise that away unless you tell it not to.
What do you mean? Variables do not necessarily need to be used, you can allocate memory for some value and initialise it but then simply don’t do anything with it.
You can but compilers will optimise that away unless you tell it not to.