C++ Institute CPA-21-02 Question Answer
What is the output of the program?
#include
#include
using namespace std;
class First
{
string name;
public:
First() {
name = "Alan";
}
void Print(){
cout << name;
}
};
int main()
{
First ob1,*ob2;
ob2 = new First();
ob1.Print();
ob2?>Print();
}