#include<iostream>
using namespace std;
struct info
{
int age;
char *name;
};
void output(struct info personal)
{
cout<<"personal.age:"<<personal.age<<endl;
cout<<"personal.name:"<<personal.name<<endl;
}
void main()
{
cout<<"input age&name:"<<endl;
info person;
cin>>person.age;
cin>>person.name;
output(person);
}
源代码如上,程序运行会崩溃,我没有查出原因,麻烦大神帮我看一下,谢谢!
C:\Users\Administrator\Desktop |
|