Look at your case statement
case 2:
p[1].search();
You have not defined any override of
search
that does not take any parameters. Look at your Patient class
class Patient
{
int id;
char name[30];
float age;
char sex[6];
int room_no;
public:
void show();
void add();
void search(Patient*p);
};
You could get around it with
case 2:
p[1].search(&p[1]);
but I think you need to do some rethinking