📄 address.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 + -