@the_tech_beast to C & C++ • 3 years agoWhat is the use of a void function if it doesn't return a value?message-square22arrow-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-square22
minus-square@pancakelink5•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