Doubt about the usage of string

sir, in this given problem, if adjacent elements are equal then we are adding s[0]+string()+res why can’t we add s[0]+""+res I tried using the latter on but its giving an error for me also in not work the " " directs adds up to string but why its not happening here.

Thanks :slight_smile:

Anyone who can answer?

See this first answer

Bhaiya then do char pointer ko add Karne mai kya dikkat hai ?

It’s because addition with pointers works different. They are addresses.
See this and

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.