Question: Exercise P7.13. Write a program that reads lines of text and appends them to a char buffer [1000]. Stop after reading 1,000 characters. As you

![appends them to a char buffer [1000]. Stop after reading 1,000 characters.](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66e312bad70ff_49866e312ba44bbb.jpg)
Exercise P7.13. Write a program that reads lines of text and appends them to a char buffer [1000]. Stop after reading 1,000 characters. As you read in the text, replace all newline characters ' ' with '\o' terminators. Establish an array char lines [100], so that the pointers in that array point to the beginnings of the lines in the text. Only consider 100 input lines if the input has more lines. Then display the lines in reverse order, starting with the last input line. (4) Problem P7.13 . Implement the program described in Problem P7.13 . Use getline to read in the txt ne into char buffer [1000] .After a line is read in, ask the user if another line is expected (y/u). If "y", then read in the next line into buffer, otherwise stop the input. . You can assume that the user inputs no more than 100 lines. .If a lne cannot be placed into buffer due to its size, stop the input (see the saple of input-output) . Note 1: getline automatically removes the new line character ' in the end of the line . Note 2: To append each line (which is of type string as it is read in by using getline) to buffer use the function strcpy.s which deals with C-style strings. The method of the string class that returns C-style string, called c-str() , will automatically add '\0' to the C-style string Submit the solution in the file named hmw 1 4.c . Samples of input-output pp C:Wind Enter a line: Hello ontinue (y)? y Enter a line: Hello World Continue (y)? y Enter a line: Hello World Again Continue y>? n Lines in reversed order: exe Hello World Again Hello World Hello Press any key to continue.. ontinue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
