a

#include<iostream>
#include<string>
using namespace std;

struct yuangong                    //定义结构体内部变量
{
	string xingming;
	int xingzi;
	int gongzuoshichang;
};

int main()
{
	struct yuangong stu1 = { "赵六",14,57 };//结构体数据输入

	struct yuangong* p = &stu1;             //录入指针

	cout << p->xingming << endl;  
	cout << p->xingzi << endl;
	cout << p->gongzuoshichang << endl;

	system("pause");
	return 0;
}

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐