Char array palindrome

it should be -2 na because last char will be \0 and index starts from 0 so n-1 index and -1 for \0? so n-2

\0 is present at nth index not n-1

but indexing starts from 0 na so n-1 for nth index an d n-2 for \0 because length will give size inlcuding \0 na?

when we say the length of a string is n we do not include \0

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.