摘要: int find_substr(char *s1, char *s2){ int t; char *p, *p2; for (t = 0; s1[t]; t++) //字符串常量是存在数组中的s1[0]就是字符串第一个字符 { p = &s1[t]; p2 = s2; while (*p2 && (*p2 == *p)) //先比较s1,s2的值是不是相等的,不相等就跳过 { //这里的与运算是测试P2是不是到最后字符了就是'\0' ... 阅读全文
posted @ 2013-05-17 17:41 ★行云流水★ 阅读(611) 评论(0) 推荐(0) 编辑