#include #include using namespace std; //myStructArrayPtr3.cpp //Struct cotained array //pointer represents array index //operator -> // return an index to struct-array typedef struct Emp { string name; string sal; int id; } pEmp; // function prototypes with pointer int emp_record(pEmp[], int n1); void display(pEmp obj1); int main() { pEmp emprec[3]={ {"A","45k", 10}, {"B","55k", 11}, {"C","65k", 12} }; int lid, index ; cout<<"\n Enter emp lid " ; cin>> lid; display(emprec[lid ]); //using pointer to struct member cout<<"\n Enter emprec->id " ; cin>> emprec->id; index= emp_record(emprec, emprec->id); cout<< "\n index " << index; display(emprec[index ]); return 0; } int emp_record(pEmp array[], int n1) { int i; cout<<"\n veryfying index emp_recrod function " << n1; for(i=0; i < 3; i++ ) { if(i <3){ return (n1); } else { return (-1); } } } void display(pEmp obj1) { cout<<" "<< obj1.name ;cout<<" "<< obj1.id ; cout<<" "<< obj1.sal <