|
发表于 2021-8-20 21:13:49
|
显示全部楼层
类型不匹配呗
- #include "stdafx.h"
- #include <iostream>
- #include <Windows.h>
- #include <string>
- using namespace std;
- struct family {
- string ba_ba;
- string ma_ma;
- string jie_1;
- string jie_2;
- string wo;
- };
- int main() {
- family wo_jia = { "爸爸" ,"妈妈" ,"大姐" ,"二姐" ,"弟弟(我)" };
- cout << wo_jia.ba_ba << endl;
- cout << wo_jia.ma_ma << endl;
- cout << wo_jia.jie_1 << endl;
- cout << wo_jia.jie_2 << endl;
- cout << wo_jia.wo << endl;
- getchar();
- return 0;
- }
复制代码 |
|