![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言
文章平均质量分 69
zishare
这个作者很懒,什么都没留下…
展开
-
C语言细节知识积累: strncpy
为了截取部分字符串,我们经常需要使用strncpy 如下面这段截取年、月、日的代码 #include #include int main(int argc, char *argv[]) { char *sInput = "20110910";原创 2011-09-10 08:28:45 · 633 阅读 · 0 评论 -
BASH源码理解1
为了搞定字符终端交互处理的一些编程问题,决定分析一下shell的代码。 找了一个BASH的代码。 来源:http://tiswww.case.edu/php/chet/bash/bashtop.html BASH:The GNU Bourne-Again SHell Th原创 2011-09-11 07:49:45 · 2217 阅读 · 0 评论 -
linux下的usleep
sleep()是以秒为单位的,要想延迟一个较小的时间,就需要用到usleep()。 另外还有个nanosleep(),用法好像很复杂。 usleep可能很难保证时间精度。我写了一段测试代码 #include #include #include int main(v原创 2011-09-15 19:59:28 · 3755 阅读 · 0 评论