Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Page 294/ Prob. 8 8. a. Write a function in C that takes an array of char and a

ID: 3638094 • Letter: P

Question

Page 294/ Prob. 8

8.            a. Write a function in C that takes an array of char and a char ** expression as parameters. The array of type char would contain a string the possibly starts with a sequence of decimal digits. Have the function convert the sequence of decimal digits it finds to type int and return the converted value. Have the function set the contents of its second parameter (a char * value) to point to the first character in the array that was not converted. For example, if the function was called convert () and the call to convert () was

                                intval = convert (array, & charptr);

                where array contained the string

2

7

4

A

D

A

M

S

/0

                then after the call, intval would contain the 274, and charptr would point to the ‘A’ in the string.

2

7

4

A

D

A

M

S

/0

Explanation / Answer

Before you ask someone else to do your homework, at least make an attempt. Then post what you have done and where you are stuck, then someone might help you. I don't think anyone here will do your homework for you.