12.06.2017, 13:25
You're checking if the parameter is a string and in the next sscanf line you're checking if it's an integer. It can't be string and integer at the same time.
Use optional parameters
Now the second parameter (integer) is optional
If a person uses take order but doesn't give a value for choice2 , it defaults to -1.
However if they choose a valid number the remaining codes are executed.
Also remove the second sscanf line.
Use optional parameters
Код:
if(sscanf(params,"s[50]I(-1)", choice,choice2)
If a person uses take order but doesn't give a value for choice2 , it defaults to -1.
However if they choose a valid number the remaining codes are executed.
Also remove the second sscanf line.