This is your third post of the same question, and you are still making the same mistake that I pointed out in the first one. You have the following code at the beginning:
int waiting_time = atof(argv[1]);
Then further down you have:
int wait_time = 1; if (argc > 1) {
wait_time = atof(argv[1]);
}
But ib both cases you declare the variables as
int
types, so calling
atof
makes no sense. And since the
sleep
function only accepts integer values there is no point in trying to capture the value as a float. So change the first line just after
main
to:
int wait_time = atoi(argv[1]);
And remove the other lines where you try to capture it a second time.