&ch in cout statement

Is there any advantage of &ch (character) showing the value instead of address in cout statements? Why does it happen this way?

Hey @diganta_7777
I can’t think of any advantage, I never really came across it after studying it.


The answer to this issue is explained very beautifully in this post.
The brief idea is just that when you do &ch, you get char* data type. So cout interprets char* as a sequence of characters or a string and prints as long as it doesn’t encounter a null in memory.

Got it! Thanks! .

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.