上一页 1 ··· 302 303 304 305 306 307 308 309 310 ··· 408 下一页
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; int ch; char filename[FILENAME_MAX]; printf("please input filename: "); scanf("%s", filename); if((fp 阅读全文
posted @ 2021-06-08 22:50 小鲨鱼2018 阅读(63) 评论(0) 推荐(0)
摘要: c语言中显示文件内容。 1、 #include <stdio.h> int main(void) { FILE *fp; // 定义FILE型的指针变量,用于接收fopen函数返回的流指针 int ch; // 声明字符,注意是int char filename[FILENAME_MAX]; // 阅读全文
posted @ 2021-06-08 22:29 小鲨鱼2018 阅读(636) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #include <time.h> char filename[] = "timedata.dat"; void put_dat(void) { FILE *fp; if((fp = fopen(filename, "r")) == NULL) print 阅读全文
posted @ 2021-06-08 18:18 小鲨鱼2018 阅读(92) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #include <time.h> char file[] = "datatime.dat"; void put_data(void) { FILE *fp; if((fp = fopen(file,"r")) == NULL) // 未检测到datati 阅读全文
posted @ 2021-06-08 17:42 小鲨鱼2018 阅读(295) 评论(0) 推荐(0)
摘要: c语言中写入日期和时间。 1、 #include <stdio.h> #include <time.h> int main(void) { FILE *fp; time_t current = time(NULL); struct tm *timer = localtime(&current); i 阅读全文
posted @ 2021-06-08 12:39 小鲨鱼2018 阅读(1103) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #include <time.h> // time_t数据类型,日历时间头文件 int main(void) { time_t current = time(NULL); // 利用time函数获取日历时间(返回1970之后的秒数,整型) struct t 阅读全文
posted @ 2021-06-08 12:28 小鲨鱼2018 阅读(2230) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #define NUMBER 6 typedef struct{ char name[128]; double height; double weight; }Type1; int main(void) { FILE *fp; fp = fopen("xx 阅读全文
posted @ 2021-06-07 21:45 小鲨鱼2018 阅读(65) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #include <string.h> typedef struct{ char name[128]; double height; double weight; }Type1; void swap2(Type1 *x, Type1 *y) { Type1 阅读全文
posted @ 2021-06-07 19:01 小鲨鱼2018 阅读(52) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> typedef struct{ char name[128]; double height; double weight; }Type1; void swap(Type1 *x, Type1 *y) { Type1 tmp = *x; *x = *y; * 阅读全文
posted @ 2021-06-07 18:44 小鲨鱼2018 阅读(41) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> typedef struct{ char name[128]; double height; double weight; }Typex; void swap(Typex *x, Typex *y) { Typex tmp = *x; *x = *y; * 阅读全文
posted @ 2021-06-07 16:25 小鲨鱼2018 阅读(37) 评论(0) 推荐(0)
上一页 1 ··· 302 303 304 305 306 307 308 309 310 ··· 408 下一页