// practice4-6.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
struct CandyBar
{
char brand[20];
double weight;
int calorie;
};
int _tmain(int argc, _TCHAR* argv[])
{
using namespace std;
CandyBar snack[3]=
{
{"rhhgjg",2.2,450},
{"tjhlkdf",4.3,444}
};
cout<<snack[0].brand<<","<<snack[1].brand<<endl;
system("pause");
return 0;
}
简单的struct数组
最新推荐文章于 2023-12-08 16:26:25 发布