73.结构体指针参数传递
目录
一.结构体指针参数传递
二.视频教程
一.结构体指针参数传递
结构体指针也可以作为参数传递,相对于结构体变量参数传递,结构体指针变量作为函数参数传递速度更快,效率更高。
举例:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>struct test {int a;int b;
};void change(struct test *p)
{p->a = 3;p->b = 4;
}int main(void)
{struct test y = {1,2};change(&y);printf("y.a is %d,y.b is %d\n",y.a,y.b);return 0;}
二.视频教程
73.结构体指针参数传递_哔哩哔哩_bilibili