蛋疼的C语音字符串拷贝 strncpyr
2015-10-30 19:09
375 查看
uint8_t *strncpyr(uint8_t *dest, const uint8_t *src, int8_t r, int32_t n) { int32_t pos = 0; for(pos = 0; ((src[pos] != 0) && (src[pos] != r) && (pos < n)); pos++) { dest[pos] = src[pos]; } dest[pos] = 0; return dest; }
相关文章推荐
- keepalive自动安装脚本
- mysql中kill掉所有锁表的进程
- I/O重定向
- Perl 关于在程序运行过程中重新开启标准输入的问题
- cocos2dx java调用c++
- java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
- 按回车不提交,表单验证,验证之后提交。
- keepalive监控nginx
- hdu1032 The 3n + 1 problem
- .net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind解决办法
- haproxy配置文件详解
- Case函数的使用及注意点
- GCC damangling stack traces
- Android开发 命名规范
- linux下使用 aapt 解包
- HDU 2093 模拟
- 数据挖掘-SPSS Modeler17
- Android-Android4.3 蓝牙BLE初步
- [OpenJudge 7834]分成互质组 迭代加深+剪枝
- Linux C 指针