摘要: 1 /* 2 queue.h -- Queue接口 3 */ 4 5 #ifndef QUEUE_H 6 #define QUEUE_H 7 8 #define MAXQUEUE 10 9 10 typedef int Item; 11 12 typedef struct node 13 { 14 阅读全文
posted @ 2018-07-09 22:49 web1013 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 list.h -- 简单链表类型的头文件 3 */ 4 5 #ifndef LIST_H 6 #define LIST_H 7 8 #define TSIZE 45 9 10 typedef struct film 11 { 12 char title[TSIZE]; 13 int r 阅读全文
posted @ 2018-07-04 15:05 web1013 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 varargs.c -- use variable number of arguments 3 */ 4 5 #include <stdio.h> 6 #include <stdarg.h> 7 8 double sum(int, ...); 9 10 int main() 11 { 阅读全文
posted @ 2018-07-03 22:22 web1013 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 mems.c -- 使用 memcpy() 和 memmove() 3 */ 4 5 #include <stdio.h> 6 #include <string.h> 7 #include <stdlib.h> 8 9 #define SIZE 10 10 11 void show_a 阅读全文
posted @ 2018-07-03 15:15 web1013 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 qsorter.c -- 用 qsort() 排序一组数字 3 */ 4 5 #include <stdio.h> 6 #include <stdlib.h> //提供函数 rand() 原型 7 8 #define NUM 40 9 10 void fillarray(double 阅读全文
posted @ 2018-07-03 14:05 web1013 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 rect_pol.c -- 把直角坐标转换为极坐标 3 */ 4 5 #include <stdio.h> 6 #include <math.h> 7 8 #define RAD_TO_DEG (180 / (4 * atan(1.0))) 9 10 typedef struct po 阅读全文
posted @ 2018-07-03 10:50 web1013 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 predef.c -- 预定义宏和预定义标识符 3 */ 4 5 #include <stdio.h> 6 7 void why_me(void); 8 9 int main() 10 { 11 printf("The file is %s.\n", __FILE__); 12 pri 阅读全文
posted @ 2018-07-03 10:08 web1013 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 names_st.h -- names_st 结构的头文件 3 */ 4 #ifndef NAMES_ST_H 5 #define NAMES_ST_H 6 7 #include <string.h> 8 9 #define SLEN 32 10 11 //结构声明 12 struct 阅读全文
posted @ 2018-06-26 15:10 web1013 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 dualview.c -- 位字段和按位运算符 3 */ 4 5 #include <stdio.h> 6 #include <limits.h> 7 8 //边框线样式 9 #define SOLID 0 10 #define DOTTED 1 11 #define DASHED 2 阅读全文
posted @ 2018-06-25 10:41 web1013 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 invert4.c -- 使用位操作显示二进制 3 */ 4 5 #include <stdio.h> 6 #include <limits.h> //提供 CHAR_BIT 的定义,CHAR_BIT 表示每字节的位数 7 8 char* itobs(int, char*); 9 vo 阅读全文
posted @ 2018-06-21 10:17 web1013 阅读(130) 评论(0) 推荐(0) 编辑