摘要:
1、 #include <stdio.h> #include <time.h> void put_data(void) { FILE *fp; if((fp = fopen("time.txt", "r")) == NULL) printf("\aThe program is running for 阅读全文
摘要:
利用函数库获取当前时间。 1、 #include <stdio.h> #include <time.h> int main(void) { time_t current = time(NULL); struct tm *timer = localtime(¤t); printf("cur 阅读全文
摘要:
1、 #include <stdio.h> int main(void) { FILE *fp; char name[128]; double height, weight; if((fp = fopen("a.txt", "w")) == NULL) printf("\aFile open fai 阅读全文
摘要:
1、写入日期和时间 #include <stdio.h> #include <time.h> int main(void) { FILE *fp; time_t current = time(NULL); struct tm *timer = localtime(¤t); if((fp 阅读全文
摘要:
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; * 阅读全文
摘要:
c语言中统计文件字符数 1、 #include <stdio.h> int main(void) { FILE *fp; char c1[128]; int lines = 0; fp = fopen("a.txt", "r"); while(fscanf(fp, "%s", c1) == 1) { 阅读全文
摘要:
1、 #include <stdio.h> int main(void) { FILE *fp; int lines = 0; char name[128]; double height, weight; double hsum = 0, wsum = 0; if((fp = fopen("a.tx 阅读全文
摘要:
13 - 1、 #include <stdio.h> int main(void) { FILE *fp; char filename[FILENAME_MAX]; printf("filename: "); scanf("%s", filename); if((fp = fopen(filenam 阅读全文
摘要:
1、 #include <stdio.h> int main(void) { int ch; FILE *sfp; FILE *dfp; char sfile[FILENAME_MAX]; char dfile[FILENAME_MAX]; printf("source file name: "); 阅读全文
摘要:
1、 #include <stdio.h> #include <ctype.h> int main(void) { int n; unsigned long count = 0; // count初始值为0, 为什么是unsigned long? unsigned char buf[16]; //字 阅读全文