a function which takes a string (pointer to char) as a parameter and returns the
integer equivalent.str2 int("1658") would return the value 1658
To improve your program change the function to accept strings with a leading minus sign toi ndicate a negative number.
One last improvement might be to print a warning if the string represents a numberthat is outside the range of an int.
integer equivalent.str2 int("1658") would return the value 1658
To improve your program change the function to accept strings with a leading minus sign toi ndicate a negative number.
One last improvement might be to print a warning if the string represents a numberthat is outside the range of an int.
Comment