Question: Write the following subroutine, which captures a user - entered string at run - time, storing it as a null - terminated character array (
Write the following subroutine, which captures a userentered string at runtime, storing it as a nullterminated character array just like the STRINGZ pseudoop with the big difference that STRINGZ requires a hardcoded character array at compiletime ; ; Subroutine: SUBGETSTRING ; Parameter R: The starting address of the character array ; Postcondition: The subroutine has prompted the user to input a string, ; terminated by the ENTER key the "sentinel" and has stored ; the received characters in an array of characters starting at R ; the array is NULLterminated; the sentinel character is NOT stored. ; Return Value R: The number of nonsentinel chars read from the user. ; R contains the starting address of the array unchanged. ; This subroutine should prompt the user to enter in a string of text, ending with the ENTER key. The string of text will be stored starting at whatever address is specified by R and will be NULLterminated ie the subroutine will store zero x # as a sentinel at the end of the array
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
