+ 2
Can anyone please explain the output?
char a = 'a', b = 'b' ; char *p = &a; char *&r = p; //This statement is new for me r = &b; cout<<*p;
5 Respostas
+ 5
Hello,
@Harshit I have a code for you to understand it. It is with comments explained in it.
https://code.sololearn.com/cpYPAKefbNP8/#cpp
+ 3
https://www.sololearn.com/Discuss/1028274/explaination-needed-for-this-code
@Harshit See this it is answered.
+ 2
@Harshit it is giving output :- ba$ ( when I used cout << p; I don't know the reason. I am too new to c++. But I am going to ask this in a post or on discord server of the sololearn.
+ 1
When I ask for cout<<p it shows 'ba' , reason?
+ 1
Hey pal, thanks so much trying to help me. But this one, I already knew that it shows the address of p but what I don't get is why does it show 'ba'? why 'a' after 'b' ?