结构 结构数组,强化型的数组,可以存储各种数据类型
#include"iostream"
struct MyStruct //存储在结构中的各种数据类型
{
std::string name_str;
char name_char[20];
float volume;
double price;
};
int main()
{
using namespace std;
MyStruct first =
{
"first",
"first",
0.2,
12.49
};
cout << first.name_char << endl;
cout<< first.price << first.volume << endl;
cin.get();
return 0;
}