03 2016 档案

C语言 百炼成钢19
摘要:/* 题目55: 有一个字符串符合以下特征(”abcdef,acccd,eeee,aaaa,e3eeeee,sssss,";),要求写一个函数(接口),输出以下结果 1) 以逗号分割字符串,形成二维数组,并把结果传出; 2) 把二维数组行数运算结果也传出。 strchr(“aa,aa”,’,’ ); 请自己定义一个接口(函数)。 要求1:能正确表达功能的要求,定义出接口(函数)(30... 阅读全文

posted @ 2016-03-24 15:07 寒魔影 阅读(303) 评论(0) 推荐(0) 编辑

C语言 字符串操作两头堵模型
摘要://字符串操作两头堵模型练习 #define _CRT_SECURE_NO_WARNINGS #include #include #include //去除字符串中的空格 //const char *pin的解释:const char *pin是用来限制指针pin指向的数据是个常量,不允许修改, //但是并不限制实参指针指向的数据也必须是一个常量 //这是为了防止传过来的参数pin所指向的数... 阅读全文

posted @ 2016-03-22 11:03 寒魔影 阅读(747) 评论(1) 推荐(1) 编辑

C语言 后缀自增的优先级详解
摘要:// ++ 后缀自增与取地址& ,提领 * (指针里的操作符)的优先级比较 #include #include #include void main(){ char *p1 = "qwert"; char *p2 = (char *)malloc(sizeof(char)*10); while (p1 != '\0'){ *p2++ = *p1++; ... 阅读全文

posted @ 2016-03-15 15:45 寒魔影 阅读(1144) 评论(2) 推荐(0) 编辑

C语言 指针与字符串
摘要:C语言可以在栈区 or 堆区 or 全局区 存放字符串,字符串不单单是存储在全局区的。 阅读全文

posted @ 2016-03-15 13:52 寒魔影 阅读(613) 评论(0) 推荐(0) 编辑

C语言 野指针与空指针
摘要://野指针与空指针的区别 #define _CRT_SECURE_NO_WARNINGS #include #include //野指针是指存在一个指针变量,但是这个指针变量指向的内存空间已经被释放,这时候指针的值还是不为空 //再次调用free()函数就会报错;空指针是值为NULL的指针变量 void main(){ int *p = (int *)malloc(sizeof(i... 阅读全文

posted @ 2016-03-14 09:46 寒魔影 阅读(951) 评论(0) 推荐(0) 编辑

C语言 日常小结
摘要:1.当数组当作函数参数的时候会退化为指针 #include<stdio.h> #include<stdlib.h> void sort(int a[]){ int num = sizeof(a); printf("数组的大小num=%d\n", num);//打印4,此时a是一个指针 //打印数组 阅读全文

posted @ 2016-03-09 14:03 寒魔影 阅读(438) 评论(0) 推荐(0) 编辑

C语言 原码--反码--补码
摘要://原码,反码,补码 #include<stdio.h> #include<stdlib.h> //数值的表示方法——原码、反码和补码 //原码:最高位为符号位,其余各位为数值本身的绝对值 //反码: //正数:反码与原码相同 //负数:符号位为1,其余位对原码取反 //补码: //正数:原码、反码 阅读全文

posted @ 2016-03-09 10:24 寒魔影 阅读(701) 评论(0) 推荐(0) 编辑

C语言 百炼成钢18
摘要://题目52:用递归打印以下图形 //* //*.*. //*..*..*.. //*...*...*...*... //*....*....*....*....*.... #include #include //分析:熟练使用递归,递归比较难以理解,可以先写出for循环,再写递归 //递归的一般形式 //void 函数名(参数列表){ // if (终止条件) // { // ... 阅读全文

posted @ 2016-03-07 23:20 寒魔影 阅读(272) 评论(0) 推荐(0) 编辑

C语言 共用体
摘要://共用体 union #define _CRT_SECURE_NO_WARNINGS #include #include #include // union 共用体,构造数据类型,也叫联合体,用途:十几个不同类型的变量共占一段内存(相互覆盖) //共用体在类型定义的时候并不分配内存,定义共用体变量的时候才分配内存 union data{ char c; int a[10... 阅读全文

posted @ 2016-03-07 15:04 寒魔影 阅读(679) 评论(0) 推荐(0) 编辑

C语言 结构体
摘要://结构体 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h> //结构体是一种构造数据类型,用途把不同的数据组合成一个整体 //结构体变量数据大,作为参数的时候一般会使用结构 阅读全文

posted @ 2016-03-07 15:02 寒魔影 阅读(417) 评论(0) 推荐(0) 编辑

C语言错误 BUG报错整理
摘要:错误一 关键字:间接寻址级别不同 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <string.h> char strcat(char *a,char *b) { char c[199] 阅读全文

posted @ 2016-03-07 10:58 寒魔影 阅读(968) 评论(0) 推荐(0) 编辑

C语言 const与指针
摘要://const与指针 #include #include void main(){ int num1 = 10; const int num2 = 10; const int *p; p = &num1; //p可以变化 p = &num2; //p可以变化 //*p = 5; 报错 这表明p指向一个常量,这个指针不可以改变指向的数据... 阅读全文

posted @ 2016-03-04 15:41 寒魔影 阅读(247) 评论(0) 推荐(0) 编辑

C语言 复杂队列(链表队列)
摘要://复杂的队列二 --链表队列 #include #include #define datatype int struct queuelink{ datatype data;//数据 int high;//优先级 struct queuelink *pnext;//下一节点的指针 }; typedef struct queuelink QueueLink; /... 阅读全文

posted @ 2016-03-03 14:05 寒魔影 阅读(558) 评论(0) 推荐(0) 编辑

C语言 简单的队列(数组队列)
摘要://简单的队列 #include #include #define datatype int #define N 10 //定义队列结构体 struct queue{ int front;//队头 int endline;//队尾 datatype data[N];//数据 }; typedef struct queue Queue; Queue myQueue... 阅读全文

posted @ 2016-03-02 17:47 寒魔影 阅读(4388) 评论(0) 推荐(0) 编辑

C语言 复杂的栈(链表栈)
摘要://复杂的栈--链表栈 #include #include #define datatype int//定义链表栈数据类型 //定义链表栈结构 struct stacklink{ datatype data; struct stacklink *pnext; }; typedef struct stacklink StackLink; //判断栈是否为空 int isem... 阅读全文

posted @ 2016-03-01 13:35 寒魔影 阅读(656) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示