-3

I'm familiar with int main() and void main(), but I saw that our professor at uni uses main () -just main(), nothing else- in his codes, what exactly does it do? I read that it won't work on new C standards, but I tried it on my computer and it worked fine.

Does main() return a value like int main() or is it more like void main()?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
MichaelX
  • 99
  • 1
  • 5

1 Answers1

0

It used to be you could leave them off in C and that would default to int, but no more. As for the main function. The return type of main must be int.

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164