#include
#include
#include
using namespace std;
class person{
public:
char name;
int id;
void shuru();
void shuchu();
};
void person::shuru()
{cin>>id;
cin>>name;}
void person::shuchu()
{cout<<"shuruchenggong"<int main(){
person person1;
cout<<"请输入要添加的成员信息"<shuru();person1.shuchu();
return 0;}
>
```c++
```
加个暂停 试试
int main()
{
person person1;
cout<<"请输入要添加的成员信息"<<endl;
person1.shuru();person1.shuchu();
system("pause"); // 暂停
return 0;
}
因为你输入完之后,不加暂停,程序直接执行完了,程序就退出了,自然黑框就结束了。
struct stu
{
int num;
char name[20];
char sex;
float score;
}*boy1,boy2; //boy1是结构体指针,boy2是结构体
(*boy1).num或者boy1->num都可以
boy1=(struct stu*)malloc(sizeof(struct stu));
ps->;num=102;
ps->;name=“Zhang ping”;
ps->;sex=‘M’;
ps->;score=62.5;
free(boy1);