Question: Which statement is true about a 2 . p ? #include using namespace std; class A { public: int * p; A ( ) {

Which statement is true about a2.p?
#include
using namespace std;
class A
{
public:
int *p;
A()
{
this->p = new int;
}
};
int main(int argc, char const *argv[])
{
A a1, a2;
*(a1.p)=2;
a2= a1;
return 0;
}
Group of answer choices
a2.p is a pointer pointing to the memory address that a1.p is pointing at.
a2.p is a pointer pointing to the memory address of a1.p.
a2.p is a pointer pointing to the memory address that contains the same value as what a1.p is containing.
a2.p is a pointer pointing to the memory address that contains the same value as the memory address that a1.p is pointing at, and these two memory addresses are not the same.
a2.p and a1.p has the same value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!