上一页 1 ··· 299 300 301 302 303 304 305 306 307 ··· 403 下一页
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; //打开文件时,必须要提前在函数中定义FILE*型指针变量, 然后将fopen函数返回的FILE型指针对象赋值给定义的指针变量,就可以通过该变量来修改文件了 fp = fopen("a.txt","r" 阅读全文
posted @ 2021-06-06 20:28 小鲨鱼2018 阅读(690) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; char filename[128]; printf("filename: "); scanf("%s", filename); fp = fopen(filename, "r"); if(fp != 阅读全文
posted @ 2021-06-06 09:44 小鲨鱼2018 阅读(52) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> int main(void) { FILE *fp; char filename[128]; printf("filename: "); scanf("%s", filename); fp = fopen(filename, "r"); if(fp != 阅读全文
posted @ 2021-06-06 09:26 小鲨鱼2018 阅读(44) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #include <math.h> #define sqr(x) ((x) * (x)) typedef struct{ double x; double y; }Point; typedef struct{ Point pt; double fuel; 阅读全文
posted @ 2021-06-05 21:32 小鲨鱼2018 阅读(79) 评论(0) 推荐(0)
摘要: c语言中用结构体表示点的坐标,并计算两点之间的距离 1、 #include <stdio.h> #include <math.h> #define sqr(x) ((x) * (x)) typedef struct{ double x; double y; }Point; double dist(P 阅读全文
posted @ 2021-06-05 17:07 小鲨鱼2018 阅读(1834) 评论(0) 推荐(0)
摘要: 1、 1.1 #include <stdio.h> #include <string.h> #define NUMBER 5 #define NAME_LEN 64 typedef struct{ char name[NAME_LEN]; int height; float weight; long 阅读全文
posted @ 2021-06-05 16:11 小鲨鱼2018 阅读(47) 评论(0) 推荐(0)
摘要: c语言中的结构体数组(数组元素为结构体)。 1、 #include <stdio.h> #include <string.h> #define NUMBER 5 #define NAME_LEN 64 typedef struct{ char name[NAME_LEN]; int height; 阅读全文
posted @ 2021-06-05 13:03 小鲨鱼2018 阅读(1268) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> typedef struct{ int x; long y; double z; }Assign; Assign fun(int a, long b, double c) { Assign tmp; tmp.x = a; tmp.y = b; tmp.z 阅读全文
posted @ 2021-06-05 12:06 小鲨鱼2018 阅读(52) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #define NAME_LEN 64 typedef struct student{ char name[NAME_LEN]; int height; float weight; long schols; }Student; void judg(Stud 阅读全文
posted @ 2021-06-05 11:50 小鲨鱼2018 阅读(52) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> struct xyz{ int x; long y; double z; }; struct xyz fun(int a, long b, double c) //函数的返回类型为struct xyz型 { struct xyz tmp; //声明结构体对 阅读全文
posted @ 2021-06-05 11:28 小鲨鱼2018 阅读(1023) 评论(0) 推荐(0)
上一页 1 ··· 299 300 301 302 303 304 305 306 307 ··· 403 下一页