the_tech_beast to C & C++ · 3 years agoWhat is the use of a void function if it doesn't return a value?message-squaremessage-square22fedilinkarrow-up16arrow-down11
arrow-up15arrow-down1message-squareWhat is the use of a void function if it doesn't return a value?the_tech_beast to C & C++ · 3 years agomessage-square22fedilink
minus-squarepancakelinkfedilinkarrow-up5·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