摘要: 1 #include "stdafx.h" 2 #include 3 #include 4 using namespace std; 5 6 //栈的链式存储结构及实现 7 //栈的结构定义 8 #define OK 1 9 #define ERROR 010 #define TRUE 111 #define FALSE 012 typedef int sElemType;13 typedef int Status;14 15 16 typedef struct StackNode17 {18 sElemType data;19 struct StackNode *ne.. 阅读全文
posted @ 2014-02-08 17:15 CrazyCode. 阅读(2635) 评论(0) 推荐(0) 编辑
摘要: 1 #include "stdafx.h" 2 #include 3 #include 4 using namespace std; 5 6 //栈的顺序存储结构及实现 7 //栈的结构定义 8 #define OK 1 9 #define ERROR 010 #define TRUE 111 #define FALSE 012 #define MAXSIZE 513 typedef int sElemType;14 typedef int Status;15 typedef struct16 {17 sElemType data[MAXSIZE];18 int top.. 阅读全文
posted @ 2014-02-08 16:06 CrazyCode. 阅读(657) 评论(0) 推荐(0) 编辑
摘要: 1 #include "stdafx.h" 2 #include 3 #include 4 using namespace std; 5 6 //一系列状态 7 #define OK 1 8 #define ERROR 0 9 #define TRUE 1 10 #define FALSE 0 11 typedef int Status; 12 13 //线性表的顺序存储 14 #define MAXSIZE 20 15 typedef int ElemType; 16 typedef struct 17 { 18 ElemType data[MAXSIZE... 阅读全文
posted @ 2014-02-08 14:53 CrazyCode. 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 转载的:http://www.cnblogs.com/qyaizs/articles/2039101.html分三块来讲述: 1 首先://注意在C和C++里不同 在C中定义一个结构体类型要用typedef: typedef struct Student { int a; }Stu; 于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struct Student stu1;来声明) 这里的Stu实际上就是struct Student的别名。Stu==struct Student 另外这里也可以不写Student(于是也... 阅读全文
posted @ 2014-02-08 11:59 CrazyCode. 阅读(187) 评论(0) 推荐(0) 编辑