+ 1
what is the situation to use void? can we replace void with int ?
3 Respostas
+ 3
you can replace void with int if you want to return something(to be more specific...if you want to return an integer value)
void functions doesn't return anything...
+ 1
A void function does not return anything and only runs the code inside it. If you want your function to return a int then replace the void with an int.
0
a void function used where the function doesn't return any value u can also give int at that time but you should also include return0 in the below function