Why can't we use string instead of char?

It is not working if we use string instead of char array

Hey @priya_Jain
According to me we can who said we can’t?
Please share your code and I will check that.

Here I did 2 changes and mentioned them in comments :https://ide.codingblocks.com/s/327522