最近搬家, 好多东西, 那就无聊地写个对应的程序吧:

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

struct SMALL_BAG
{
	string tooth_brush;
	string cup;
};

struct BIG_BAG
{
	SMALL_BAG small_bag;
	string wallet;
};

int main()
{
	BIG_BAG big_bag;
	big_bag.small_bag.tooth_brush = "1";
	big_bag.small_bag.cup = "2";
	big_bag.wallet = "3";

	return 0;
}



本文转载:CSDN博客