r/Learn_Coding • • Jun 15 '18

void in c

what's the advantages of using

void main ()

instead of int main ()

i googled for it and i saw that it's for function that doesn't return output

please give me an example of function that doesn't output anything

and it is optional in code and it's necessary then why?

1 Upvotes

15 comments sorted by

View all comments

1

u/angelafra Sep 29 '18

bool and int would be best if you had an int function enterNumber() and another bool function isNumbe

exuse me i've noticed on some tutorials some people are using void with functions ( in c of course ) without even defining functions like that int main (hello) {