the_tech_beast@lemmy.ml to C & C++@lemmy.ml · 3 years agoWhat is the use of a void function if it doesn't return a value?message-squaremessage-square24fedilinkarrow-up16arrow-down10
arrow-up16arrow-down1message-squareWhat is the use of a void function if it doesn't return a value?the_tech_beast@lemmy.ml to C & C++@lemmy.ml · 3 years agomessage-square24fedilink
minus-squarepancake@lemmy.mllinkfedilinkarrow-up4·3 years agoIt could also modify memory. If the function writes to a global variable or to an address passed as a parameter, then it makes a difference. For example, would you say the void function ‘free()’ is useless?
It could also modify memory. If the function writes to a global variable or to an address passed as a parameter, then it makes a difference. For example, would you say the void function ‘free()’ is useless?
Thanks