Question: Write a C program that repeatedly inputs strings. Each time a string is input, concatenate if with a second string called bigstr. Add newlines to
Write a C program that repeatedly inputs strings. Each time a string is input, concatenate if with a second string called bigstr. Add newlines to the end of each string. If the user types quit, stop inputting and display bigstr(which will contain a record of all strings input). Also stop if bigstr will be overrun by the next concatenation.
hints: 1. gets(str) or scanf() to read string from console 2. strcpy(to, from) to copy string from one to another 3. strcat(str, "aaa") to add the contents of one string to another 4. strcmp(s1, s2) compare two strings. 5. strlen(str) returns the length, in character. of a string.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
