- 博客(17)
- 收藏
- 关注
转载 4.5.15.枚举
转载至朱老师课件4.5.15.枚举4.5.15.1、枚举是用来干嘛的?(1)枚举在C语言中其实是一些符号常量集。直白点说:枚举定义了一些符号,这些符号的本质就是int类型的常量,每个符号和一个常量绑定。这个符号就表示一个自定义的一个识别码,编译器对枚举的认知就是符号常量所绑定的那个int类型的数字。(2)枚举中的枚举值都是常量,怎么验证?(3)枚举符号常量和其对应的常量数字相对来说,...
2018-12-26 17:57:50
184
转载 offsetof宏与container_of宏
转载自朱老师课堂课件4.5.11.offsetof宏与container_of宏4.5.11.1、由结构体指针进而访问各元素的原理(1)通过结构体整体变量来访问其中各个元素,本质上是通过指针方式来访问的,形式上是通过.的方式来访问的(这时候其实是编译器帮我们自动计算了偏移量)。4.5.11.2、offsetof宏:(1)offsetof宏的作用是:用宏来计算结构体中某个元素和结构体首地...
2018-12-25 20:56:05
197
转载 结构体内存对齐1--课堂课件1
作者:海子 出处:http://www.cnblogs.com/dolphin0520/ 本博客中未标明转载的文章归作者海子和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 结构体字节对齐 ...
2018-12-25 19:27:46
144
原创 国嵌数据结构学习--队列的特别实现--两个栈
#include <stdio.h>#include <stdlib.h>#include "SQueue.h"//准备两个栈实现队列 //当有新元素入队时,将其压入inStack中,当需要出队时,//当outStack为空时,将inStack中的元素逐一弹出并压入outStack中,//将outStack栈顶元素弹出;当outStack不为空时,直接将out...
2018-08-14 10:56:15
149
原创 国嵌数据结构学习--队列的链式实现优化
#include <stdio.h>#include <stdlib.h>#include "LinkQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, cha...
2018-08-14 09:49:50
158
原创 数据结构---队列的顺序实现的优化实现
#include <stdio.h>#include <stdlib.h>#include "SeqQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char ...
2018-08-13 13:04:22
161
原创 数据结构--队列的链式实现
#include <stdio.h>#include <stdlib.h>#include "LinkQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char...
2018-08-13 12:12:55
139
原创 数据结构--队列的顺序结构
#include <stdio.h>#include <stdlib.h>#include "SeqQueue.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char ...
2018-08-13 11:41:49
243
原创 数据结构--栈的链式结构
#include <stdio.h>#include <stdlib.h>#include "LinkStack.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char...
2018-08-13 10:57:42
193
原创 数据结构---顺序栈的实现
#include <stdio.h>#include <stdlib.h>#include "SeqStack.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char ...
2018-08-13 10:24:47
183
原创 数据结构--循环链表
#include <stdio.h>#include <stdlib.h>#include "CircleList.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */typedef struct value{...
2018-08-11 22:32:58
150
原创 数据结构---双向链表的实现
#include <stdio.h>#include <stdlib.h>#include "DLinkList.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */struct value{ DLinkLis...
2018-08-11 16:59:40
693
原创 数据结构--单链表的实现
#include <stdio.h>#include <stdlib.h>#include "LinkList.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */struct value{ LinkListN...
2018-08-10 17:25:44
273
原创 数据结构--顺序表的实现
#include <stdio.h>#include <stdlib.h>#include "SeqList.h" /* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char ...
2018-08-10 16:00:04
275
原创 找出数组中出现次数最多的数字
#include <stdio.h>#include <stdlib.h>/* run this program using the console pauser or add your own getch, system("pause") or input loop */void search(int array[],int len){ int copy_a...
2018-08-10 10:07:02
3314
原创 数据结构--递归学习
#include <stdio.h>#include <stdlib.h>/* run this program using the console pauser or add your own getch, system("pause") or input loop */void Reverse(char *str){ if((str==NULL)||(*s...
2018-08-10 09:44:36
229
原创 递归--回溯-八皇后问题--国嵌数据结构学习笔记
#include <stdio.h>#include <stdlib.h>/* run this program using the console pauser or add your own getch, system("pause") or input loop */typedef struct{ int posi; int posj;}...
2018-08-09 20:38:04
167
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人