Discuss the below:
Q1) Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong.
class Person
{
private:
char name[30];
int age;
public:
Person (string, int);
int setage (int);
int setname (char *);
void show (void);
};
void main()
{
Person a_group [5];
int i;
for (i=0; i<6; i++)
a_group[i].setage(i+1);
for (i=0;i<6;i++)
cout << "Person " << i+1 << " is " << a_group[i].age << end1;
}
Q2) Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong if the below codes replace the codes between the two === in 1):
void main (void)
{
Person a_person;
a_person.age = 99;
}