上一页 1 ··· 264 265 266 267 268 269 270 271 272 ··· 367 下一页
摘要: 1、 #include <stdio.h> // main函数头文件 #define NAME_LEN 64 // 对象式宏 struct student{ // 结构体声明, student是结构名, struct student是类型名, name、height、weight和schols是结构 阅读全文
posted @ 2021-06-05 09:30 小鲨鱼2018 阅读(51) 评论(0) 推荐(0) 编辑
摘要: c语言中结构体成员的初始化, 结构体的成员可以单独赋值,也可以进行整体的初始化来实现一次性赋值。 1、 #include <stdio.h> //main函数头文件 #define NAME_LEN 64 // 对象式宏 struct student{ //结构体声明, student为结构名, s 阅读全文
posted @ 2021-06-05 09:15 小鲨鱼2018 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: c语言中结构体对象的声明、结构体成员的赋值、结构体成员的显示、.句点运算符的应用 1、 #include <stdio.h> //main 函数头文件 #include <string.h> // 字符串处理库函数头文件 #define NAME_LEN 64 struct student{ // 阅读全文
posted @ 2021-06-05 08:56 小鲨鱼2018 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #include <string.h> #define NUMBER 5 #define NAME_LEN 64 void swap_int(int *x, int *y) { int tmp = *x; *x = *y; *y = tmp; } void 阅读全文
posted @ 2021-06-04 22:47 小鲨鱼2018 阅读(567) 评论(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-04 19:23 小鲨鱼2018 阅读(49) 评论(0) 推荐(0) 编辑
摘要: c语言中具有结构体成员的结构体。 1、 #include <stdio.h> #include <math.h> #define sqr(x) ((x) * (x)) typedef struct{ double x; double y; } Point; typedef struct{ Point 阅读全文
posted @ 2021-06-04 18:59 小鲨鱼2018 阅读(293) 评论(0) 推荐(0) 编辑
摘要: c语言中利用结构体计算两点之间的距离。 1、 #include <stdio.h> #include <math.h> // c语言中基本数学运算的头文件,这里 sqrt函数使用到 #define sqr(x) ((x) * (x)) // 函数式宏,计算平方 typedef struct{ //结 阅读全文
posted @ 2021-06-04 16:39 小鲨鱼2018 阅读(1549) 评论(0) 推荐(0) 编辑
摘要: 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 sch 阅读全文
posted @ 2021-06-04 13:01 小鲨鱼2018 阅读(34) 评论(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; float weigh 阅读全文
posted @ 2021-06-04 12:14 小鲨鱼2018 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> struct xyz{ int x; long y; double z; }; struct xyz input(int a, long b, double c) { struct xyz tmp; tmp.x = a; tmp.y = b; tmp.z 阅读全文
posted @ 2021-06-04 11:07 小鲨鱼2018 阅读(45) 评论(0) 推荐(0) 编辑
上一页 1 ··· 264 265 266 267 268 269 270 271 272 ··· 367 下一页