I was trying to create a program that takes arguments by command line, using main()
function arguments. As a (basic) C++ programmer (even if I know quite well pointers and array in C-style) I hardly ever used char*
strings and C-arrays. I spent some to take main()
arguments and transform it in std::string
... So asked myself: why in C++ the main()
function is not overloaded to take an std::vector<std::string> argv
instead of the old char* argv[]
?
For "overload" I mean the coexistence of main()
functions like int main()
and int main(int argc, char *argv[])
, not the overloading of a normal function made by the programmer.