Другие языки программирования и технологии

объясните структуры в C++

Как затем присваивается переменая, и т.д. желательно с примерами, и ПОНЯТНЫМИ, ПРОСТЫМИ СЛОВАМИ
// артем_дубровин_2011-11-26
#include <iostream>
#include <string>
using namespace std;

struct mystruct
{
string a;
int b;
double c;
bool d;
char e[];
};

void main()
{
mystruct first;
mystruct second;

first.a = "Hello World!"; // Так войдёт строка полностью
first.b = 45;
first.c = 96125.58;
first.d = true;
cout << endl << " Input first.e of type char[]: ";
gets(first.e);

fflush(stdin); // Требуется очистка входного потока
cout << endl << " Input second.a of type string: ";
cin >> second.a; // Допустим ввод только строки без пробела
cout << endl << " Input second.b of type int: ";
cin >> second.b;
cout << endl << " Input second.c of type double: ";
cin >> second.c; // Разделитель - точка
cout << endl << " Input second.d of type bool: ";
cin >> second.d; // Для булевого типа водится число 0 или 1
fflush(stdin); // Требуется очистка входного потока
cout << endl << " Input second.e of type char[]: ";
gets(second.e);

cout << endl << endl << " first.a = " << first.a;
cout << endl << " first.b = " << first.b;
cout << endl << " first.c = " << first.c;
cout << endl << " first.d = " << boolalpha << first.d;
cout << endl << " first.e = " << first.e;

cout << endl << " second.a = " << second.a;
cout << endl << " second.b = " << second.b;
cout << endl << " second.c = " << second.c;
cout << endl << " second.d = " << boolalpha << second.d;
cout << endl << " second.e = " << second.e;

fflush(stdin);
cin.get();
}
Коля Фирулев
Коля Фирулев
81 156
Лучший ответ
Юрий Новиков И что - это работает?
cout
Структуры в C.
В С++ классы уже. Объяснять много, так что - лучше читай учебник. Смысла его тут копипастить я не вижу.. .