Hi.
I am making a simple console program that takes in command line arguement using Visual Studio C++ 6.0.
In Turbo C++ 3.0, I can use "void main(int argc, char *argv[])" to takes in arguement, however when I do this in Visual Studio, it gives me an error:
: error C2731: 'main' : function cannot be overloaded
: see declaration of 'main'
May I know how I can do the "void main(int argc, char *argv[])" for Visual Studio C++?
Thanks in advance.



LinkBack URL
About LinkBacks



People coming from very old style C will run into this error when they try to use a K&R style function declaration with an ISO style function definition. Because C++ never had K&R style functions, the second is parsed as an overload.