Question: you need to write a C function named start. The prototype is: int start(int argc, char **argv); The function accepts an argc and argv that
you need to write a C function named start. The prototype is:
int start(int argc, char **argv);
The function accepts an argc and argv that are passed to main. The return value is as follows:
if argc<>2, return -1 if argc==2, then return the following:
if argv[1] is not an integer, return -2 if argv[1] is an integer but is not positive, return -3 otherwise argv[1] is a positive integer: return its value
You must use sscanf (as usual). Be sure to check the return value from sscanf to determine whether or not its argument represents an integer.
Write your own main test function to test your start function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
