why the code is not running?
#include<iostream>
#include<string.h>
using namespace std;
class person
{
char name[20];
float age;
public:
person(char *s,float a)
{
strcpy(name,s);
age=a;
}
person & person::greater(person &x)
{
if(x.age>=age)
return x;
else
return *this;
}
void display(void)
{
cout<<"Name:"<<name<<"\n"<<"Age:"<<age<<"\n";
}
int main()
{
person P1("John",37.50),P2("Ahmed",29.0),P3("Hebber",40.25);
person P('\0',o);
P=P1.greater(P3);
cout<<"Elder person is: \n";
P=P1.greater(P2);
cout<<"Elder person is: \n";
P.display();
}
}