- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
#include <iostream>
using namespace std;
struct CandyBar
{
char name[20];
float weight;
int energy;
};
int main()
{
CandyBar * snack = new CandyBar;
*snack =
{
"Moncha Munch",
2.3,
350
};
cout << "Имя = " << *snack->name;
cout << "\nМасса = " << (*snack).weight;
cout << "\nЭнергетическая ценность = " << snack->energy << "\n";
return 0;
}