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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!