#include "stdafx.h"
#include <iostream>
using namespace std;struct Goods{char* name;//char* 类型 float price;
};//这个分号别忘了int _tmain(int argc, _TCHAR* argv[])
{struct Goods goods = {"巧克力",1.5};cout<<goods.name<<endl<<goods.price<<endl;struct Goods goods2;goods2 = goods;cout<<goods2.name<<endl<<goods2.price<<endl;struct Goods goods3;//goods3 ={"鼠标",2.5};//错误goods3.name = "鼠标";goods3.price = 2.5;cout<<goods3.name<<endl<<goods3.price<<endl;return 0;
}//巧克力
//1.5
//巧克力
//1.5
//鼠标
//2.5
//请按任意键继续. . .