摘要:
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)
摘要:
typedef的作用是对数据类型进行同义声明。 1、 #include <stdio.h> #define NAME_LEN 64 typedef struct student{ //结构的类型名是struct student, 此处使用typedef为类型名strucnt student声明了St 阅读全文
posted @ 2021-06-05 10:41
小鲨鱼2018
阅读(669)
评论(0)
推荐(0)
摘要:
c语言中将结构体对象指针作为函数的参数实现对结构体成员的修改。 1、 #include <stdio.h> #define NAME_LEN 64 struct student{ char name[NAME_LEN]; int height; float weight; long schols; 阅读全文
posted @ 2021-06-05 10:08
小鲨鱼2018
阅读(1873)
评论(0)
推荐(0)
摘要:
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
阅读(68)
评论(0)
推荐(0)
摘要:
c语言中结构体成员的初始化, 结构体的成员可以单独赋值,也可以进行整体的初始化来实现一次性赋值。 1、 #include <stdio.h> //main函数头文件 #define NAME_LEN 64 // 对象式宏 struct student{ //结构体声明, student为结构名, s 阅读全文
posted @ 2021-06-05 09:15
小鲨鱼2018
阅读(1810)
评论(0)
推荐(0)
摘要:
c语言中结构体对象的声明、结构体成员的赋值、结构体成员的显示、.句点运算符的应用 1、 #include <stdio.h> //main 函数头文件 #include <string.h> // 字符串处理库函数头文件 #define NAME_LEN 64 struct student{ // 阅读全文
posted @ 2021-06-05 08:56
小鲨鱼2018
阅读(506)
评论(0)
推荐(0)