Question: C++ Arrays, Functions, Loops Write a function that returns the integer representation of a positive integer value stored in a char array. The function must
C++ Arrays, Functions, Loops


Write a function that returns the integer representation of a positive integer value stored in a char array. The function must return -1 if the value in the char array is not a positive integer number (a negative number, a decimal number, an array with characters..) For example, given the input char myNumberl- 12590157 Your function should return the value 12590157 The main function will get from input a divisor and the integer number as a character, and print the result of the division as proof of correctness of the conversion. You can use the pow function from cmath to calculate the power of a number given the base and the exponent double pow(double double). Consider the powers of 10 to calcula 53-1 * 10 A 3 + 4 * 2 + 5 10 " + 3 * 10-o te the final integer value (example: 14 main.cpp 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
