//code for out putting on the file private.dat. #include<iostream.h> #include<fstream.h> #include<stdlib.h> void main() { ofstream my_record("private.dat",ios::out); if(!my_record) { cerr<<"the fail can not be created"<<endl; exit(1); } int age; char name[10]; int registration; while(cin>>age>>name>>registration) { my_record<<age<<' '<<name<<' '<<registration<<endl; cout<<"---"<<endl; } //code for in putting on the file private.dat. #include<iostream.h> #include<fstream.h> #include<stdlib.h> void display(int,const char*const,int); void main() { ifstream my_record("private.dat",ios::in); if(!my_record) { cerr<<"the fail can not be found"<<endl; exit(1); } int age; char name[10]; int registration; cout<<"AGE\t NAME \tREGESTRATION"<<endl; while(my_recod>>age>>name>>registration) diplay(age,name,registration); } void display(int d,const char*const t, int y) { cout<<d<<'\t'<<'\t'<<t<<'\t'<<'t'<<y<<endl; }