What is the use of a[i]='\0

in character input video 3 we have done a[i]!=’\0’;
why?

hi @arnavsingh88888888_c06bfcee2a553263,
character array needs to know where to stop, so its terminated by ‘\0’ symbol
say you want to store “abc” and array is of size 10 then u need to store the symbol so that it prints till “abc” not whole size (10) with garbage

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.