Code:
void main() { ... }
is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1[2] or the ISO C standard 5.1.2.2.1.
A conforming implementation accepts and
Code:
int main(int argc, char* argv[]) {}
In C++, main() need not contain an explicit return statement. In that case, the value returned is 0, meaning successful execution. For example:
Code:
#include<iostream>
int main()
{
std::cout << "This program returns the integer value 0\n";
}
if you want your software to be portable, please make main return int. It does matter.
Code:
extern int main(int, char *[]);
int argc;
char *argv[MAXARGS];
int status;
...
Code:
status = main(argc, argv);
exit(status);