#include<iostream>
using namespace std;
struct teacher
{
int age;
char name[20];
};
void print1(techer * tp){ //传递的是一个指针 可以修改
cout<<tp->age;
}
void print2(techer tp){ //相当于赋值操作,无效。
cout<<tp.age;
tp.age=100; //是无效的
}
void print3(techer & tp){ //传递的是一个引用 ,可以修改
cout<<tp->age;
tp.age=30;
}
int main(){
teacher t1;
t1.age=80;
print1(&t1);
print2(t1);
print3(t1);
}