查找字符串中最长子串,例如“I love OC”最长子串为“love”
1 void findMaxLengthSubstr1(char *src) 2 { 3 char *start = src; 4 char *end = src; 5 unsigned int maxLength = 0; 6 unsigned int tempLength = 0; 7 // 此处子串长度不能超过100 8 char maxStr[100] = "0"; 9 10 if (src == NULL) 11 { 12 return ; 13 } 14 while (*end != '