Question: 18. (12 pts) Write a function called string_to int) that accepts a string, called str, asa parameter and returns the corresponding integer that the sequence

18. (12 pts) Write a function called string_to int) that accepts a string, called str, asa parameter and returns the corresponding integer that the sequence of characters represent. For example if the string is "45", then the function returns integer 45. If the string is "-100", then the function returns -100. Precondition: the string must consist of digit (0' '9') and sign (") characters only. Hint: you may se string.h library functions where appropriate. Recall, "0'- 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
