3 ms·
void main() does not exactly inspire confidence. https://stackoverflow.com/questions/636829/difference-between-void-main-and-int-main-in-c-c https://stackoverf
by zabzonk 6y ago
void main() does not exactly inspire confidence.
https://stackoverflow.com/questions/636829/difference-between-void-main-and-int-main-in-c-c https://stackoverflow.com/questions/636829/difference-betwee...
- mazieres 6y agoUmm... if you download the code you will see that main returns int, but the main1...main6 functions invoked by main return void because they don't need to return a value.
- zabzonk 6y agoI copy and pasted `void main()` from the article. If you read the SO question I linked, you would see that `void` is not a valid return type for `main`.
- mazieres 6y agoOh, that must be a typo in the document, sorry. I just fixed it. The actual corodemo.cc file was correct, though: http://www.scs.stanford.edu/~dm/blog/corodemo.cc http://www.scs.stanford.edu/~dm/blog/corodemo.cc Also, here's a more authoritative source than stack overflow for the return type of main: https://timsong-cpp.github.io/cppwp/n4861/basic.start.main#2 https://timsong-cpp.github.io/cppwp/n4861/basic.start.main#2