网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

C语言str部分函数实现

int m_strstr(const char*dst,const char*sub)

员工经过长期磨合与沉淀,具备了协作精神,得以通过团队的力量开发出优质的产品。创新互联建站坚持“专注、创新、易用”的产品理念,因为“专注所以专业、创新互联网站所以易用所以简单”。公司专注于为企业提供成都网站设计、成都网站制作、外贸网站建设、微信公众号开发、电商网站开发,小程序定制开发,软件按需网站开发等一站式互联网企业服务。

{

if (dst == NULL || sub == NULL)

return NULL;

int d_length = strlen(dst) + 1;

int s_length = strlen(sub) + 1;

int dst_index;

int sub_index;

int j;

for (dst_index = 0; dst_index < d_length; ++dst_index)

{

sub_index = 0;

if (dst[dst_index] == sub[sub_index])

{

j = dst_index;

while (dst[j] == sub[sub_index])

{

++sub_index;

++j;

if (sub_index == (s_length - 1))

return dst_index;

}

}

}

return -1;

}

char* m_strcpy(char* dst, const char* src)

{

if (dst == NULL || src == NULL)

return NULL;

char* dst_t = dst;

while (*dst_t++ = *src++);

return dst;

}

void* m_memmove(void* dst,const void* src,int count)

{

if (dst == NULL || src == NULL)

return NULL;

char* dst_t = (char*)dst;

char* src_t = (char*)src;

int s_length = strlen(src_t) + 1;

if ((int)dst < (int)src || (int)dst >(int)src + s_length)

{

while (count--)

{

*dst_t++ = *src_t++;

}

}

else

{

while (count)

{

*(dst_t + count) = *(src_t + count);

count--;

}

}

return dst;

}

int m_strcmp(const char* dst, const char* src)

{

assert(dst == NULL);

assert(src == NULL);

while ((*dst++ == *src++)&&(*dst != '\0')&&(*src != '\0'));

return *dst - *src;

}


当前标题:C语言str部分函数实现
浏览路径:http://bjjierui.cn/article/iihogs.html

其他资讯