Question requirements: for example, if the large string asasd asa small string as is n = 3, the answer is as follows: This is not difficult to understand, so no comments are added. [Cpp] nt findStr (char * str, char * substr) {char * p = str, * q = substr, * tem1 = NULL, * tem2 = NULL; int slen = strlen (str), sublen = strlen (substr); int count = 0; while (p-str <slen) {tem1 = p; tem2 = q; while (* tem1 = * tem2 & tem2-substr <sublen) {tem1 ++; tem2 ++; if (tem2-substr = sublen) {count ++; break ;}} p ++;} return count;} use an array to implement int findStr (char * str, char * substr) {int I = 0, j = 0; int tem1 = I, tem2 = j; int count = 0; While (str [I]! = '\ 0') {tem1 = I; tem2 = j; while (str [tem1] = substr [tem2] & substr [tem2]! = '\ 0') {www.2cto.com tem1 ++; tem2 ++; if (substr [tem2] =' \ 0') {count ++; break ;}} I ++;} return count ;}