class company { char cmp_id[10]; char cmp_nm[100]; char addrs[100]; char city[100]; char state[100]; char vacancy[100]; char req_skill[100]; char c_eml[100]; char c_pwd[10]; public: void add(); void disp(); friend class admin; void getdata() { company obj; cout<<"\nEnter Your Company Id. "; fflush(stdin); v_id(cmp_id , num); cout<<"\nEnter The Company Name : "; gets(cmp_nm); fflush(stdin); // v_name(cmp_nm,min); cout<<"\nEnter The Address :"; gets(addrs); fflush(stdin); cout<<"\nEnter City : "; gets(city); fflush(stdin); cout<<"\nEnter vacancy :"; gets(vacancy); fflush(stdin); } void showdata() { cout<<cmp_id<<"\t"<<cmp_nm<<"\t"<<addrs<<"\t"<<city<<"\t"<<state<<"\t"<<vacancy<<"\t"<<req_skill<<"\t"<<c_eml<<"\n"; } char *getid() { return cmp_id; } }; void admin :: search_cmp() { company cmp_obj; fstream f; int ch; char c_nm[100]; char c_ct[100]; char c_vac[100]; clrscr(); f.open("company.dat",ios :: binary | ios ::in); f.read((char*)&cmp_obj,sizeof(cmp_obj)); do { cout<<"\n\t 1]. Company By Name"; cout<<"\n\t 2]. Company By City"; cout<<"\n\t 3]. Company By Vacancy"; cout<<"\n\t 4]. Back"; cout<<"\n\t Enter Your Choice :"; cin>>ch; switch(ch) { case 1: cout<<"\n Enter Company city :"; cin>>c_ct; while(!f.eof()) { if(strcmp(c_ct,cmp_obj.city)) { cmp_obj.showdata(); } } break; case 4: cout<<"\nPress Any Key To Continue "; break; } }while(ch!=4); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)