Write a function char * maxword (char *r, char *t) to find the longest common word in the two strings, assuming both are

** Write a function char * maxword (char r, char t) to find the longest common word in the two strings, assuming both are

topic

Insert picture description here

Code (source code click here)

The code is mainly for string operations. The string is still relatively weak, especially the pointer nesting.
This question requires no space for storing words, that is, words cannot be compared, hey. Suffering, I'm really too difficult,
there are two ways to achieve it,

  • One is to set the space for storing words
  • One is that there is no storage space for words

Set up storage spaceInsert picture description here

Insert picture description here

No storage space

Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/honeylife/article/details/102800582