In the below code what does “a” and “&a” contains?
class list{
};
int main(){
list *a= new list();
cout<<"\n Values:a="<<a<<" & &a="<<&a<<endl;
return 0;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ais a pointer to the object list which is allocated on heap.basically
acontains an address(pointer stores an address,if you are aware).And
&adoes not contain anything.what you are doing is actually taking the address of that pointer and printing it.