# include <stdio.h> # include <stdlib.h> # include <string.h> # include <malloc.h> //创建一个结构体 typedef struct programmer { int salary; int experience; char type[15]; } Programmer; void OneyearLater(Programmer *); int main () { Programmer p = {15000, 3, "PHP"}; printf("岗位:%s 当前薪资:%-5d 当前经验:%d年 ",p.type, p.salary, p.experience); OneyearLater(&p); printf("------------------一年后--------------------- "); printf("岗位:%s 当前薪资:%-5d 当前经验:%d年 ",p.type, p.salary, p.experience); return 0; } //一年后 void OneyearLater(Programmer *p) { p->salary = 18000; p->experience = 4; }