Question: Write in C programming Language Write a function that converts from an octal or decimal string to an integer. Do not use any library function.
Write in C programming Language
Write a function that converts from an octal or decimal string to an integer. Do not use any library function. Your function should recognize octal numbers through a leading zero. You may assume that the resulting integers fit into an int. Return -1 if the given string is not a valid octal or decimal number.
int parseInt(char *string);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
