#include <stdio.h>
#include <string.h>
#include <string.h>
struct Student
{
int sid;
char name[200];
int age;
}; //分号不能省;
void f(struct Student * pst);
void g(struct Student st);
void g2(struct Student * pst);
{
int sid;
char name[200];
int age;
}; //分号不能省;
void f(struct Student * pst);
void g(struct Student st);
void g2(struct Student * pst);
int main (void)
{
struct Student st;
f(&st);
zhi2(&st);
//printf("%d %s %d\n",st.sid,st.name,st.age);
return 0;
}
{
struct Student st;
f(&st);
zhi2(&st);
//printf("%d %s %d\n",st.sid,st.name,st.age);
return 0;
}
void zhi1(struct Student st) //内存,不建议使用
{
printf("%d %s %d\n",st.sid,st.name,st.age);
}
{
printf("%d %s %d\n",st.sid,st.name,st.age);
}
void zhi2(struct Student * pst)
{
printf("%d %s %d\n",pst->sid,pst->name,pst->age);
}
{
printf("%d %s %d\n",pst->sid,pst->name,pst->age);
}
void f(struct Student * pst)
{
(*pst).sid=99;
strcpy(pst->name,"zhangsan");
pst->age=23;
}