11 2015 档案
摘要:#define _CRT_SECURE_NO_WARNINGS #include #include #include //两个辅助指针变量挖字符串, 的第三种内存模型 //指针做函数参数 void FreeMem(char **myp,int count) //释放内存函数 { int i=0; if(myp == NULL) { ...
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include #include #include //两个辅助指针变量挖字符串, 的第三种内存模型 //指针做函数参数 int spitString4(char *buf1,char c,char ***myp3,int *count) //**pp二级指针做输入 { char *p=NULL, ...
阅读全文
摘要:#include #include #include //两个辅助指针变量挖字符串, 的第三种内存模型 char ** spitString3(char *buf1,char c,int *count) //**pp二级指针做输入 { char *p=NULL, *pTmp = NULL; int tmpcount = 0; char **myp...
阅读全文
摘要:#include #include #include //两个辅助指针变量挖字符串, 的第三种内存模型 int spitString2(const char * buf1,char c,char **myp/*in*/,int *count) //**pp二级指针做输入 { char *p=NULL, *pTmp = NULL; int tmpcount...
阅读全文
摘要:#define _CRT_SECURE_NO_WARNINGS #include #include #include //有一个字符串符合以下特征(”abcdef,acccd,eeee,aaaa,e3eeeee,sssss,";) //分清楚赋值指针变量 和 操作逻辑之间的关系 int spitString(const char *buf1, char c, char buf...
阅读全文
摘要:#include #include #include char **getMem51(int num) { int i = 0; char **p2 = NULL; p2 = (char **)malloc(sizeof(char *) * num); if (p2 == NULL) { return NULL; } ...
阅读全文
摘要://指针数组 char *pszBuf[] = {"123", "456", "789"}; //二维数组 char *psz[3][4] = {"123", "456", "789"}; //手工二维内存 char **p3 = (char **)malloc(3 * sizeof(char *)); //这句相当于int array[...
阅读全文
摘要:学过概率统计的孩子都知道,统计里最基本的概念就是样本的均值,方差,或者再加个标准差。首先我们给你一个含有n个样本的集合,依次给出这些概念的公式描述,这些高中学过数学的孩子都应该知道吧,一带而过。均值:标准差:方差:很显然,均值描述的是样本集合的中间点,它告诉我们的信息是很有限的,而标准差给我们描述的...
阅读全文
摘要:#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...
阅读全文
摘要:#include #include #include //打印 排序 //封装成函数 void main() { int i = 0, j = 0; int num = 4; char tmpBuf[30]; char myArray[10][30] = {"aaaaaa", "ccccc", "bbbbbbb", "111111111111...
阅读全文
摘要:#include #include #include void main21() { int i = 0, j = 0; int num = 0; char *tmp = NULL; //数组 数组中的每一个元素是指针 指针数组 char *myArray[] = {"aaaaaa", "ccccc", "bb...
阅读全文
摘要:#include #include #include //指针做输出:被调用函数分配内存 -----OK//指针做输入:主调用函数 分配内存//求文件中的两段话的长度int getMem(char **myp1, int *mylen1, char **myp2, int *mylen2){ ...
阅读全文
摘要:const int a; //代表整型变量a不能被修改 int const b; const char *c; //看const 是放在*的左边还是右边 看const是修饰指针变量,还是修饰所指向的内存空变量 char * const d; char buf[100] #include #include #include void main() { ...
阅读全文
摘要:1、char *(字符串)做函数参数出错模型分析 建立一个思想:是主调函数分配内存,还是被调用函数分配内存; //不要相信,主调函数给你传的内存空间,你可以写。。。。。。一级指针你懂了。 但是二级指针,你就不一定懂。。。抛出。。。。。。。。。 void copy_str21(char *from, char *to) { if (*NULL = '\0' || *to!=’\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+...
阅读全文
摘要:#include #include #include /*============================================================== 有一个字符串”1a2b3d4z”,; 要求写一个函数实现如下功能, 功能1:把偶数位字符挑选出来,组成一个字符串1。valude;20分 功能2:把奇数位字符挑选出来,组成一个字符串2,...
阅读全文
摘要:#include #include #include #include /*======================================================================================= 键值对(”key = valude”)字符串,在开发中经常使用; 要求1:请自己定义一个接口,实现根据key获取valude;40...
阅读全文
浙公网安备 33010602011771号