C Program

This affairs expects two command-line arguments: the aboriginal is a string, the additional a cardinal n. The affairs charge actuate and account all audible substrings of breadth n that ex- ist in the accustomed string. In accession to advertisement the strings, your affairs charge additionally account the cardinal of occurrences of anniversary substring, both with and with- out overlap. You ability accede defining a action based on the band-aid to ... countsubs.c that can be alleged (twice) back outputting anniversary cord to accommodate the requisite information. If the cardinal of command-line ar- guments is incorrect or if the additional command-line altercation represents an accumulation 6 0, an adapted acceptance bulletin charge be printed to accepted absurdity and the affairs charge arrest with avenue cachet 1. The afterward are some sample, non-exhaustive analysis cases. Your affairs is expected to aftermath identical output. Do not alert for input. 1 $ ./a . out aaabccbcbcebcebfff 2 Acceptance : cord n (where n charge be > 0 ) 3 $ answer $? 4 1 5 $ ./a . out aaabccbcbcebcebfff 3 6 7 Unique substrings of breadth 3 : 8 9 aaa / 1 / 1 10 aab / 1 / 1 11 abc / 1 / 1 12 bcc / 1 / 1 13 ccb / 1 / 1 14 cbc / 2 / 1 15 bcb / 1 / 1 16 bce / 2 / 2 17 ceb / 2 / 2 18 ebc / 1 / 1 19 ebf / 1 / 1 20 bff / 1 / 1 21 fff / 1 / 1 22 $ ./a . out aaabccbcbcebcebfff 2 23 24 Unique substrings of breadth 2 : 25 26 aa / 2 / 1 27 ab / 1 / 1 28 bc / 4 / 4 29 cc / 1 / 1 30 cb / 2 / 2 31 ce / 2 / 2 32 eb / 2 / 2 33 bf / 1 / 1 34 ff / 2 / 1 35 $ ./a . out aaabccbcbcebcebfff 4 36 37 Unique substrings of breadth 4 : 38 39 aaab / 1 / 1 40 aabc / 1 / 1 41 abcc / 1 / 1 42 bccb / 1 / 1 43 ccbc / 1 / 1 44 cbcb / 1 / 1 45 bcbc / 1 / 1 46 cbce / 1 / 1 47 bceb / 2 / 1 48 cebc / 1 / 1 49 ebce / 1 / 1 50 cebf / 1 / 1 51 ebff / 1 / 1 52 bfff / 1 / 1 53 $ ./a . out aaabccbcbcebcebfff 10   Problem 2: Write a C program, namely "parsestring.c", that does the fol- lowing until EOF: i) reads a band from accepted input, including an abandoned line, with getline, ii) tokenizes the band based on spaces and tabs, iii) builds an arrangement of appearance arrays (pointers) to abundance the badge of the line, iv) address anniversary badge to accepted achievement from that arrangement of appearance pointers, and v) frees the arrangement of appearance pointers. For instance, if the ascribe band is one two three four, the anatomy congenital is: And the achievement is: 1 : one : 2 : two : 3 : three: 4 : four : The afterward are some sample, non-exhaustive analysis cases. Your program is accepted to aftermath identical output. Do not alert for input. 1 $ ./a . out 2 one two three four 3 : one : 4 : two : 5 : three: 6 : four : 7 angel orange pear auto lime 8 : apple: 9 : orange: 10 : pear : 11 : lemon: 12 : adhesive : 13 14 −a −b −c −d −e −f −h 15 :−a : 16 :−b : 17 :−c : 18 :−d : 19 :−e : 20 :−f : 21 :−h : 22 ^D 23 $ 24 $ c a t ascribe . txt 25 one two three four 26 angel orange pear auto lime 27 28 −a −b −c −d −e −f −h 29 $ 30 $ ./a . out < input. txt 31 : one : 32 : two : 33 : three: 34 : four : 35 : apple: 36 : orange: 37 : pear : 38 : lemon: 39 : adhesive : 40 :−a : 41 :−b : 42 :−c : 43 :−d : 44 :−e : 45 :−f : 46 :−h :

Order a unique copy of this paper

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
Top Academic Writers Ready to Help
with Your Research Proposal
Live Chat+1(978) 822-0999EmailWhatsApp

Order your essay today and save 20% with the discount code COURSEGUY