If you want to use command line options, then no, you are not using cin , since it's too late. You need to change your main signature to:
int main(int argc, char *argv[]) {
So now you have argv , which is an array of a pointer to char , with each pointer pointing to the argument passed. The first argument is usually the path to your executable file, the subsequent arguments are all that was passed when your application started, in the form of pointers to char .
In this case, you will need to convert char* to double .
Ed S. source share