What is the output of the program?
#include
#include
using namespace std; struct Person {
int age;
};
class First
{
Person *person;
public:
First() {person = new Person;
person?>age = 20;
}
void Print(){
cout age;
}
};
int main()
{
First t[2];
for (int i=0; i
Which statement should be added in the following program to make work it correctly?
using namespace std;
int main (int argc, const char * argv[])
{
cout
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
public:
int x;
A() { x=0;}
A(int x) { this?>x=x;}
};
class B : private A {
public:
using A::x;
B() { x=1;}
B(int x) {this?>x = x;}
};
int main () {
B c1;
B c2(?5); cout