Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

24
  • 3
    Main also takes two args if you're going to be pedantic about the return type. :) (Or is that optional but not the return these days? I can't keep up.) Commented Dec 1, 2010 at 13:29
  • 3
    This is just bad - it breaks every convention of good, clean code. I can't think of a single instance where this is a good idea. Commented Dec 1, 2010 at 13:29
  • 41
    @Thomas Owens: It's good if you need a callback function and don't want to pollute some other namespace with it. Commented Dec 1, 2010 at 13:31
  • 12
    @Leo: The standard says there are two permissible forms for main: int main() and int main(int argc, char* argv[]) Commented Dec 1, 2010 at 13:33
  • 12
    The standard says int main() and int main(int argc, char* argv[]) must be supported and others may be supported but they all have return int. Commented Dec 1, 2010 at 13:37