摘要:
1、13-11 #include <stdio.h> int main(void) { FILE *fp; int i; double b[10]; double a[] = {0.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1}; if((fp = fopen("tmp 阅读全文
posted @ 2021-06-11 11:50
小鲨鱼2018
阅读(90)
评论(0)
推荐(0)
摘要:
c语言向文本文件、二进制文件中写入实数。 1、 #include <stdio.h> int main(void) { FILE *fp; double pi = 3.14159265358979323846; printf("pi from value: %23.21f.\n", pi); // 阅读全文
posted @ 2021-06-11 11:16
小鲨鱼2018
阅读(539)
评论(0)
推荐(0)
摘要:
13-8、 #include <stdio.h> int main(void) { FILE *sfp; FILE *dfp; int ch; char sfilename[FILENAME_MAX]; char dfilename[FILENAME_MAX]; printf("Please inp 阅读全文
posted @ 2021-06-11 10:39
小鲨鱼2018
阅读(45)
评论(0)
推荐(0)
摘要:
1、 #include <stdio.h> int main(void) { FILE *sfp; FILE *dfp; int ch; char sfilename[FILENAME_MAX]; char dfilename[FILENAME_MAX]; printf("Please input 阅读全文
posted @ 2021-06-11 10:00
小鲨鱼2018
阅读(185)
评论(0)
推荐(0)
摘要:
1、 #include <stdio.h> int main(void) { FILE *fp; int ch; char filename[FILENAME_MAX]; printf("Please input the filename: "); scanf("%s", filename); if 阅读全文
posted @ 2021-06-11 09:33
小鲨鱼2018
阅读(130)
评论(0)
推荐(0)
摘要:
1、 #include <stdio.h> int main(void) { FILE *fp; int ch; char filename[FILENAME_MAX]; printf("Please input the filename: "); scanf("%s", filename); if 阅读全文
posted @ 2021-06-11 09:13
小鲨鱼2018
阅读(111)
评论(0)
推荐(0)
摘要:
1、显示a.txt文件的内容 #include <stdio.h> int main(void) { FILE *fp; int ch; char filename[FILENAME_MAX]; printf("Please input the filename: "); scanf("%s", f 阅读全文
posted @ 2021-06-11 09:04
小鲨鱼2018
阅读(176)
评论(0)
推荐(0)
摘要:
1、 #include <stdio.h> #include <time.h> void put_data(void) { FILE *fp; if((fp = fopen("time.txt", "r")) == NULL) { printf("\aThe program is ran for t 阅读全文
posted @ 2021-06-11 08:11
小鲨鱼2018
阅读(87)
评论(0)
推荐(0)