
C语言
imnoqiao
这个作者很懒,什么都没留下…
展开
-
C语言截取字符串
char* substr(const char*str,unsigned start, unsigned end) { unsigned n = end - start; static char stbuf[256]; strncpy(stbuf, str + start, n); stbuf[n] = 0; return stbuf; } c中转载 2017-03-05 16:04:26 · 1147 阅读 · 0 评论 -
C语言 字符串截取
转载 作者:iamlaosong C语言字符串截取需要自己编程实现,不过,网络时代,自然不用自己从头写了,网上各种方法的实现代码已经多如牛毛了,这儿抄录一个感觉不错的备案。 [cpp] view plain copy #include #include /*从字符串的左边截取n个字符*/ char * left(ch转载 2017-03-05 16:07:06 · 1884 阅读 · 0 评论