0
what's the difference between the int main() and void main() ? what is the best for use ?
3 ответов
+ 1
Void main doesn't return a value, int main takes a return value, like # return 0; Using an int return value is pretty useful in functions that you'd want to assign it's return value to an integer, like # int a = b(2)
+ 1
Here int and void are the return data types of the 2 functions .
int main means that we are returning an integer value .
void main means that we are returning a null value or simply nothing .
As per their use , it depends on our needs and the type of value we want to return
0
thank you #Dogcatfee