=Exercise 4.31.29: In this exercise, you will manipulate C character strings, which are simply arrays of characters that are terminated by the ASCII NULL character (0x00, ’ ’). (countsubsstdin.c) This program reads two mandatory and one optional inputs from standard input, each on a separate line, until EOF. Each of the two required inputs is a string. The second string will be searched for occurrences of the first string as a substring. The number of occurrences found will then be displayed to standard output. The presence of the optional third input -nooverlap informs the program that the substrings identified may not overlap. If an incorrect number of inputs is provided, or if the optional third inputprovided is anything other than -nooverlap, an appropriate usage message must be printed to standard error and the program must halt with exit status 1. If the first argument is the empty string (i.e., a string having length 0), print an error message to standard error and the program must halt with exit status 1. Store these input strings on the heap (not the stack) so they can be of an arbitrary size. The following are some sample, non-exhaustive test cases. Your program is expected to produce identical output. Do not prompt for input.
Select your paper details and see how much our professional writing services will cost.
Our custom human-written papers from top essay writers are always free from plagiarism.
Your data and payment info stay secured every time you get our help from an essay writer.
Your money is safe with us. If your plans change, you can get it sent back to your card.
We offer more than just hand-crafted papers customized for you. Here are more of our greatest perks.
Get instant answers to the questions that students ask most often.
See full FAQ