这段代码是检测字符串s中是否有字符串t,但是看不懂 for (t_temp = t; *t_temp == *m_temp; t_temp++, m_temp++);这句代码是怎么个逻辑顺序,请指教下!
uchar *LookFor_Str(uchar *s, uchar *t)
{
uchar *s_temp;
uchar *m_temp;
uchar *t_temp;
if (s == 0 || t == 0) return 0;
for (s_temp = s; *s_temp != ' '; s_temp++)
{
m_temp = s_temp;
for (t_temp = t; *t_temp == *m_temp; t_temp++, m_temp++);
if (*t_temp == ' ')
return s_temp;
}
return 0;
}
此帖出自
小平头技术问答
一周热门 更多>