C/C++语言
文章平均质量分 92
second60
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C语言内存模型详解
C语言内存模型详解second60 201804151 内存模型在C语言中,内存可分用五个部分:1. BSS段(Block Started by Symbol): 用来存放程序中未初始化的全局变量的内存区域。2. 数据段(data segment): 用来存放程序中已初始化的全局变量的内存区域。3. 代码段(text segment): 用来存放程序执行代码的内存区域。4. 堆(heap):用来...原创 2018-04-15 06:31:19 · 13040 阅读 · 8 评论 -
[源码分析] 性能压测工具-webbench
[源码分析] 性能压测工具-webbenchsecond60 201806091. webbench简介今天和大家介绍一个网站压测性能测试工具,名字叫webbench。 a) 可测试相同硬件,不同服务的性能及不同硬件上同一个服务的运行状况。b) 可以向我们展示服务器:每秒钟相应的请求数和每秒钟传输数据量。c) 可以模拟3万个并发连接去测试网站的负载能力。 同时,webbench的代码非常精简,源...原创 2018-06-09 23:27:23 · 371 阅读 · 0 评论 -
strcmp函数实现(c语言)
strcmp函数实现(c语言)second60 20180601#include <stdio.h>int strcmp_new(const char* src, const char* dst){ int ret = 0; while( !(ret = *(unsigned char*)src - *(unsigned char*)dst) && ...原创 2018-06-01 07:43:59 · 15388 阅读 · 0 评论 -
strstr函数实现(C语言)
strstr函数实现(C语言)second60 20180601 strstr 用来字符串查找子串。 顺便说一下, 字符串操作函数是C语言中非常重要的函数,里面包括了指针的精华,同时对学习数据结构,如链表,数组,有非常好的练手方法。同时,知道内部实现,是基础中的基础。所以学习字符串操作函数是深入学C的必经之路。#include <stdio.h>#...原创 2018-06-01 07:27:57 · 22150 阅读 · 2 评论 -
strlen函数实现(c语言)
strlen函数实现(c语言)second60 20180530#include <stdio.h>#include <assert.h>int strlen_new(const char* src){ int len = 0; assert(src); while(*src++ != '\0') len ++; re...原创 2018-05-30 07:44:48 · 10301 阅读 · 0 评论 -
memcpy函数实现(c语言)
memcpy函数实现(c语言)second60 20180530#include <stdio.h>#include <assert.h>void *memcpy_new(void *to, void *from, size_t size){ char *tempFrom = NULL; char *tempTo = NULL; asse...原创 2018-05-30 07:24:34 · 900 阅读 · 0 评论 -
strcpy函数实现(C语言)
strcpy函数实现(C语言)second60 20180530#include <stdio.h>char* strcpy(char *strDest, const char* strSrc){ char *p=NULL; if(strDest == NULL || strSrc == NULL) { return NULL; }...原创 2018-05-30 07:12:27 · 28565 阅读 · 2 评论 -
字符串转整型(C语言)
字符串转整型(C语言)second60 20180529#include <stdio.h>int str2int(const char* str){ int temp = 0; const char* p = str; if(str == NULL) return 0; if(*str == '-' || *str == '+') { ...原创 2018-05-29 22:41:34 · 2970 阅读 · 2 评论 -
[源码分析]-轻量级JSON-cJson
[源码分析]-轻量级JSON-cJsonsecond60 201806121. cJSON简介cJson是个轻量级的C语言JSON库,速度快,而且代码少,只有两个文件:cJSON.h和cJSON.c。代码只有七百多行。 使用只需引入cJSON文件,一起编译即可,使用了数学库,要添加-lm库g++ test.c cJSON.c -o testgcc test.c cJSON.c -o test -l...原创 2018-06-12 17:12:25 · 1940 阅读 · 0 评论 -
整型转字符串(C语言)
整型转字符串实现(C语言)second60 20180529#include <stdio.h>// n <2的32次数,所以最大10位// n 可能为负数,也可能为正数void int2str(int n, char *str){ char buf[10] = ""; int i = 0; int len = 0; // temp为n的绝...原创 2018-05-29 07:46:11 · 5716 阅读 · 1 评论 -
源码分析-简洁的HTTPServer-tinyhttpd
源码分析-简洁的HTTPServersecond60 201806101. tinyhttpd 简介tinyhttpd 可以说是最小最精简的HTTP服务器,C语言编写,全部代码只有五百多行。通过阅读tinyhttpd源码可以了解HTTP服务器搭建的本质和HTTP基础。下载链接:http://sourceforge.net/projects/tinyhttpd/2. tinyhttpd 安装和使用...原创 2018-06-10 22:27:36 · 1533 阅读 · 0 评论
分享