1) Yes. Modify the relevant text file in the c:\dev-cpp\templates folder.
2) In C++ void main() is invalid; in C it is just non-portable and generally a bad idea. In C++ you do not actually need an explicit return statement in main() - that is true only of main() and no other function. Moreover some pre-ISO standardisation compilers don't know that (MSVC++ 6 for example) and will insist that you have an explicit return and let you use void main(). Newer versions of MSCV++ are ISO compilant in this respect however.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i mean that instead of :
include <cstdlib>
include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
system("PAUSE");
return EXIT_SUCCESS;
}
appears something else.
2.why can't i use void main?
sry if this subject had beed discussed.
thnx and i am sorry for my poor english.
1) Yes. Modify the relevant text file in the c:\dev-cpp\templates folder.
2) In C++ void main() is invalid; in C it is just non-portable and generally a bad idea. In C++ you do not actually need an explicit return statement in main() - that is true only of main() and no other function. Moreover some pre-ISO standardisation compilers don't know that (MSVC++ 6 for example) and will insist that you have an explicit return and let you use void main(). Newer versions of MSCV++ are ISO compilant in this respect however.
Clifford
Void main is wrong because everthing is done as int main.
Even my dog uses int main () {
Dont tell anyone you use void main.
Kurgusov