---
# System prepended metadata

title: Untitled

---

#include <iostream> 
#include <cstring>
#include <fstream>
using namespace std;  

struct data
{
	int num;
	char name[10];
};

int main()  
{  
	data a;
	data *b=new data[10];
	int num;
	char name[10];
    cin>>num;
    cin>>name;
    a.num=num;
    strcpy(a.name,name);

    fstream file;
	file.open("Reader.bin", ios::out | ios::binary);	
	file.write((char*)&a, sizeof(data));
	file.close();
	cout<<endl;
	file.open("Reader.bin", ios::in | ios::binary);
	file.read((char*)b, sizeof (data)*10);
	cout<<b->name<<endl<<b->num;
    return 0;
}  
