Программирование и основы алгоритмизации. Макаров В.Л. - 101 стр.

UptoLike

Составители: 

101
in.seekg(0,ios::end);
in >> x.otdel;
return in;
}
// опеpация-функция вывода стpуктуpы на дисплей
ostream &operator << (ostream &out, SOTR x)
// печать объекта
{
out << "\n|" << x.fam << "|" << x.dol << "|" << x.otdel <<"|";
return out;
}
// опеpация-функция ввода стpуктуpы c МД
ifstream &operator >> (ifstream &in, SOTR &x)
{
in.setf(ios::left);
in.width(FAM);
in.get(x.fam,FAM,'\n');
in.width(DOL);
in.get(x.dol,DOL,'\n');
in >> x.otdel;
return in;
}
// опеpация-функция вывода стpуктуpы на МД
ofstream &operator << (ofstream &out, SOTR &x)
{
out.width(FAM-1);
out.setf(ios::left);
out << x.fam;
out.width(DOL-1);
out.setf(ios::left);
out << x.dol;
out << x.otdel;
return out;
}
void main(void)
{
clrscr();
char c;
while (1)
{
cout << endl << "1.
Создание файла";
cout << endl << "2. Просмотр содержимого";
cout << endl << "3. Выход";
Рис. 15.4. Продолжение