⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 address.cc

📁 资深C++讲师授课代码
💻 CC
字号:
#include <iostream>
using namespace std;
#include <string>

struct Person{
	string name;
	bool gender;
	int age;
	double income;
};
int main()
{
	Person furong={"芙蓉", false, 38, 10000};
	cout << "&furong=" << &furong << endl;
	cout << "&furong.name=" << &furong.name << endl;
	//cout << *&furong << endl;//Person*
	cout << *&furong.name << endl;//string*
	cout << "sizeof(furong)=" << sizeof(furong) << endl;
	cout << "sizeof(furong.name)=" << sizeof(furong.name) << endl;
	cout << "sizeof(furong.gender)=" << sizeof(bool) << endl;
	cout << "sizeof(furong.age)=" << sizeof(furong.age) << endl;
	cout << "sizeof(furong.income)=" << sizeof(double) << endl;
	cout << "&furong.name=" << &furong.name << endl;
	cout << "&furong.gender=" << &furong.gender << endl;
	cout << "&furong.age=" << &furong.age << endl;
	cout << "&furong.income=" << &furong.income << endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -