/* Write the function definition for the following function prototype: int Ascii_to_integer (char *str); This string argument must contain one or more numbers, and the function should convert the numeric characters to integers and return the integer. If the string argument contains any non-numeric characters, the function returns zero. Please do not worry about arithmetic overflow. Tip: The trick is simple: Every number you find, multiply the current value by 10, and add the value to the value represented by the new number */#include <stdio.h>int ascii_to_integer (char const *STR) {int sum = 0;int P;while (*str! = ') {if (*str >= ' 0 ' && *str <= ' 9 ') {p = (int) (*STR)-sum = SUM * 1 0 + p;str++;} Elsereturn 0;} return sum;} int main () { char *p = "124few";p rintf ("converted to:%d\n", Ascii_to_integer (p)); return 0;}
"C language" for the following function prototype write function definition, this string parameter must contain one or more numbers, the function should convert these numeric characters to an integer and return this integer.