What is the output of the program?
#include
}
Which code line inserted instead of the comment below will fix the program so that it produces the expected output and does not cause any memory leak?
What will the variable "age" be in class B?
class A {
int x;
protected:
int y;
public:
int age;
A () { age=5; };
};
class B : public A {
string name;
public:
B () { name="Bob"; };
void Print() {
cout << name << age;
}
};
What will the variable "age" be in class B?
class A {
int x;
protected:
int y;
public:
int age;
A () { age=5; };
};
class B : public A {
string name;
public:
B () { name="Bob"; };
void Print() {
cout << name << age;
}
};
© Copyrights Dumpscity 2024. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the Dumpscity.