Write each token to standard output from that array of


Assignment

Problem 1

This program expects two command-line arguments: the first is a string, the second a num-ber n. The program must determine and list all distinct substrings of length n that ex- ist in the given string. In addition to listing the strings, your program must also list the number of occurrences of each substring, both with and with- out overlap. You might consider defining a function based on the solution to ... countsubs.c that can be called (twice) when outputting each string to provide the requisite information. If the number of command-line ar- guments is incorrect or if the second command-line argument represents an integer 6 0, an appropriate usage message must be printed to standard error and the program must halt with exit status 1. The following are some sample, non-exhaustive test cases. Your program is expected to produce identical output. Do not prompt for input.

Problem 2:

Write a C program, namely "parsestring.c", that does the fol- lowing until EOF: i) reads a line from standard input, including an empty line, with getline, ii) tokenizes the line based on spaces and tabs, iii) builds an array of character arrays (pointers) to store the token of the line, iv) write each token to standard output from that array of character pointers, and v) frees the array of character pointers. For instance, if the input line is one two three four, the structure built is.

Attachment:- Requirement.rar

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write each token to standard output from that array of
Reference No:- TGS02672647

Expected delivery within 24 Hours