
字符串
jun2016425
coolnqjun@163.com
展开
-
ReplaceBlank
/* length is the maxsize of string */ void replace_blank(char string[], int length) { if(NULL == string && length <= 0) return ; // originaLength real length of string int originaLength = 0; int原创 2016-08-31 20:46:46 · 341 阅读 · 0 评论 -
delete the element of array
delete element of array原创 2016-09-02 13:23:27 · 598 阅读 · 0 评论 -
strcpy和memcpy的使用,实现字符串的循环右移,
字符串的循环右移,使用库函数strcpy,memcpy实现原创 2016-08-14 15:07:02 · 721 阅读 · 0 评论 -
strcat函数实现
#include char * my_strcat(char *strDest, const char *strSrc); int main(void) { char d[20] = "hello"; char *s = ",world"; char *p = my_strcat(d, s); printf("The string is:%s\n", p); return 0; }原创 2016-08-26 15:40:51 · 651 阅读 · 0 评论 -
限制服务器的端口连接数量和端口速度
使用iptables设定特定端口连接数(万能方法) 限制端口连接数量 首先输入命令service iptables stop关闭iptables 限制端口并发数很简单,IPTABLES就能搞定了,假设你要限制端口8388的IP最大连接数为5,两句话命令: iptables -I INPUT -p tcp –dport 8388 -m connlimit –connlimit-above 5原创 2018-01-06 13:05:49 · 16463 阅读 · 0 评论 -
随机字符串产生
随机参数字符串, 字符串包括大、小字母还有数字. /* * 产生包含大写字母,小写字母和数字的随机的字符串 * * @buf[out] 存放字符串的缓存区 * @bufsize[in] 存放字符串的缓存区大小 * @string_len[in] 想要输出的字符串长度 * return: 0 成功, -1 失败 */ int generate_random_string(char *buf,原创 2018-01-06 10:18:29 · 686 阅读 · 0 评论 -
整数数字转读音 num2voice C语言版
搜索了一下:整数数字转读音,看到C++版的链接如下: http://blog.youkuaiyun.com/wangmxe/article/details/78910143 于是乎翻译成了C语言版的如下: 因为要的比较急,所有没写注释,注释请看上面给出的链接地址 int num2voice(char *dest, int dlen, int num) { char vt1[][4] = {"零...翻译 2018-03-09 11:21:37 · 820 阅读 · 0 评论