I assigned HW to a C++ student (credit to Julian Ruffin) to convert command line inputs (pointer character types) to integer, double, and boolean types. Instead of trying to convert them, he was trying to change the main,
int main(int argc, char** argv)
to
int main(int argc, int** argv)
int main(int argc, boolean** argv)
int main(int argc, double** argv).
Obviously, this does not work with current latest C++ compiler version, but this doesn’t seem impossible to implement…
This inspired me that C++ main should be implemented into “overloading” type. I know overloading functions work within custom classes we create, so why didn’t the compiler programmers think of this and make it available for the built-in main?
I can email the C++ compiler maintenance team to implement this idea or dissect the default main from the source codes to fiddle around with it to see if it could be done to make my own new-and-improve main. I want to get more opinions. What do you think? Is this possible? Share your thoughts!