Question: Programming in C Write a function that converts from an octal or decimal string to an integer. But do not use any library function. Your

Programming in C

Write a function that converts from an octal or decimal string to an integer. But 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

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!