/* This is a main routine that will call your function myErf to integrate * the error function as assigned in class */ #include #include double myErf(double step, double upper, double lower); int main(int argc, char * argv[]) { double f; double step, upper, lower; if(argc < 4){ printf("Usage: %s step_size upper_limit lower_limit\n",argv[0]); return 1; } // What you really need to pay attention to here is that argv[0] is the // executable name, in my case myErf. Statements like the one above // prevent users from creating cases where too little info is offered. step = strtod(argv[1],NULL); upper = strtod(argv[2],NULL); lower = strtod(argv[3],NULL); // The last 3 lines convert command line arguments which are // strings (arrays of characters really) to double precision numbers f = myErf(step,upper,lower); printf("This is the answer: %lf\n",f); } // Below is the function to edit. double myErf(double step, double upper, double lower) { double value; return value; }