![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
濯茶的前端思考
知乎/公号:前端疯
展开
-
make 命令详解(转)
无论是在Linux还是在Unix环境中,make都是一个非常重要的编译命令。不管是自己进行项目开发还是安装应用软件,我们都经常要用到make或make install。利用make工具,我们可以将大型的开发项目分解成为多个更易于管理的模块,对于一个包括几百个源文件的应用程序,使用make和makefile工具就可以简洁明快地理顺各个源文件之间纷繁复杂的相互关系。而且如此多的源文件,如果每次都要键入转载 2013-06-28 22:02:04 · 558 阅读 · 0 评论 -
头文件中的static inline
先看一段代码:原创 2014-11-24 13:07:24 · 1932 阅读 · 0 评论 -
C语言的malloc、calloc、realloc
创建size字节大小的内存空间:chmalloc(size);原创 2014-11-24 13:55:02 · 442 阅读 · 0 评论 -
关于结构体中的数组问题
正确的写法:#include #include using namespace std;struct Test{ int len; char ch[];};void main(){ struct Test *t; t =( struct Test *) malloc(sizeof *t+2+1); memcpy(t->ch,"ab",3); printf("%s\n",原创 2014-11-24 12:26:35 · 1590 阅读 · 0 评论 -
以资源方式打开exe
以ziyuanfahi原创 2014-10-29 09:23:05 · 769 阅读 · 0 评论 -
字典树问题
代码来源:https://github.com/Liutos/CLab/tree/master/trie代码记录知识点:原创 2014-10-21 23:17:37 · 557 阅读 · 0 评论 -
关于折半查找实现中的一个问题
#include #include //线性查找:时间复杂度是O(n)int linearSearch(int arr[],int target){ int i=0; for(i=0;arr[i];i++){ if(arr[i]==target) return i; } return -1;}//迭代折半查找:时间复杂度:T(n) = T(n/2) + c//要访问一半的数字int bina原创 2014-11-21 21:41:43 · 1263 阅读 · 0 评论 -
一些Makefile文件解读
all: sds-testsds-test: sds.c sds.h testhelp.h $(CC) -o sds-test sds.c -Wall -std=c99 -pedantic -O2 -DSDS_TEST_MAIN @echo ">>> Type ./sds-test to run the sds.c unit tests."clean: rm -f sds-testa原创 2014-11-25 10:15:10 · 786 阅读 · 0 评论 -
乘法——Karatsuba乘法
#include #include //找到x的位数int size(long x){ int count=0; do{ count++; x=x/10; }while(x); return count;}//找到x和y的最大值int max(int x, int y){ return x>y?x:y;}int getHigh(int x, int m){原创 2014-11-20 09:39:12 · 4732 阅读 · 1 评论 -
AVL树问题
AVL树不同于平衡搜索树,它有一个平衡因子的概念。就是每个节点的高度原创 2014-10-23 08:48:23 · 875 阅读 · 0 评论 -
几个C语言题目
帕斯卡三角形(杨辉三角形)问题: 形成一个杨辉三角 输入:n —-杨辉三角的高度 输出:杨辉三角 解法:/*** 下一层是上一层计算得到的,所以我们每次要保存上一层的数据***/void print(int n){ int *b = NULL;//声明一个变量来保存上一层的数据 for(int i = 1; i <= n; i++){//分别...原创 2018-04-29 21:16:33 · 373 阅读 · 0 评论