2016年3月9日

C语言 原码--反码--补码

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

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

2016年3月7日

C语言 百炼成钢18

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

posted @ 2016-03-07 23:20 寒魔影 阅读(276) 评论(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 寒魔影 阅读(690) 评论(0) 推荐(0)

C语言 结构体

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

posted @ 2016-03-07 15:02 寒魔影 阅读(422) 评论(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 寒魔影 阅读(1006) 评论(0) 推荐(0)

2016年3月4日

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 寒魔影 阅读(253) 评论(0) 推荐(0)

2016年3月3日

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 寒魔影 阅读(566) 评论(0) 推荐(0)

2016年3月2日

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 寒魔影 阅读(4433) 评论(0) 推荐(0)

2016年3月1日

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 寒魔影 阅读(664) 评论(0) 推荐(0)

2016年2月29日

C语言 简单的栈

摘要: 总结:数组栈容量有限制,不可以无限大 阅读全文

posted @ 2016-02-29 15:53 寒魔影 阅读(398) 评论(0) 推荐(0)

导航