Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started