关于结构体 赋植的问题把???
我想在函数中实现输入2个值给结构体,但是为什么在输入数据运行之后是错误的。用的是vc++6.0
# include <stdio.h>
void Input (struct Student*);
void Output (struct Student*);
struct Student
{
int age;
int score;
};
int main(void)
{
struct Student stu;
Input(&stu);
Output(&stu);
return 0;
}
void Input (struct Student * pstu)
{
scanf ("%d", pstu->age);
scanf ("%d", pstu->score);
}
void Output (struct Student * pstu)
{
printf ("年龄:%d ", pstu->age);
printf ("成绩:%d\n", pstu->score);
}