摘要: #include #include #include char **getMem51(int num) { int i = 0; char **p2 = NULL; p2 = (char **)malloc(sizeof(char *) * num); if (p2 == NULL) { return NULL; } ... 阅读全文
posted @ 2015-11-18 22:01 那时天空蓝 阅读(185) 评论(0) 推荐(0) 编辑
摘要: //指针数组 char *pszBuf[] = {"123", "456", "789"}; //二维数组 char *psz[3][4] = {"123", "456", "789"}; //手工二维内存 char **p3 = (char **)malloc(3 * sizeof(char *)); //这句相当于int array[... 阅读全文
posted @ 2015-11-18 21:34 那时天空蓝 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 学过概率统计的孩子都知道,统计里最基本的概念就是样本的均值,方差,或者再加个标准差。首先我们给你一个含有n个样本的集合,依次给出这些概念的公式描述,这些高中学过数学的孩子都应该知道吧,一带而过。均值:标准差:方差:很显然,均值描述的是样本集合的中间点,它告诉我们的信息是很有限的,而标准差给我们描述的... 阅读全文
posted @ 2015-11-18 20:57 那时天空蓝 阅读(405) 评论(0) 推荐(0) 编辑
摘要: #include #include #include void main() { int i = 0, j = 0; char **p2 = NULL; int num = 5; char *tmp = NULL; char tmpbuf[100]; //交换内存,必须申请一块buf p2 = (char **)malloc(siz... 阅读全文
posted @ 2015-11-17 20:57 那时天空蓝 阅读(190) 评论(0) 推荐(0) 编辑
摘要: #include #include #include //打印 排序 //封装成函数 void main() { int i = 0, j = 0; int num = 4; char tmpBuf[30]; char myArray[10][30] = {"aaaaaa", "ccccc", "bbbbbbb", "111111111111... 阅读全文
posted @ 2015-11-13 18:08 那时天空蓝 阅读(211) 评论(0) 推荐(0) 编辑
摘要: #include #include #include void main21() { int i = 0, j = 0; int num = 0; char *tmp = NULL; //数组 数组中的每一个元素是指针 指针数组 char *myArray[] = {"aaaaaa", "ccccc", "bb... 阅读全文
posted @ 2015-11-13 16:30 那时天空蓝 阅读(171) 评论(0) 推荐(0) 编辑
摘要: #include #include #include //指针做输出:被调用函数分配内存 -----OK//指针做输入:主调用函数 分配内存//求文件中的两段话的长度int getMem(char **myp1, int *mylen1, char **myp2, int *mylen2){ ... 阅读全文
posted @ 2015-11-13 15:41 那时天空蓝 阅读(146) 评论(0) 推荐(0) 编辑
摘要: const int a; //代表整型变量a不能被修改 int const b; const char *c; //看const 是放在*的左边还是右边 看const是修饰指针变量,还是修饰所指向的内存空变量 char * const d; char buf[100] #include #include #include void main() { ... 阅读全文
posted @ 2015-11-12 18:21 那时天空蓝 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 1、char *(字符串)做函数参数出错模型分析 建立一个思想:是主调函数分配内存,还是被调用函数分配内存; //不要相信,主调函数给你传的内存空间,你可以写。。。。。。一级指针你懂了。 但是二级指针,你就不一定懂。。。抛出。。。。。。。。。 void copy_str21(char *from, char *to) { if (*NULL = '\0' || *to!=’\0... 阅读全文
posted @ 2015-11-10 23:18 那时天空蓝 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Procedure SORTSK { read(I[1],I[2],...,I[k]); read(S[1,I[1]],S[2,I[2]],...,S[k,I[k]]) 置桶B[1],B[2],...,B[n]为空; for(i=1;i<=k;i++) { j=I[i]; for(h=1;h<=j;h+... 阅读全文
posted @ 2015-11-10 17:09 那时天空蓝 阅读(117) 评论(0) 推荐(0) 编辑