when are we supposed to give ‘\0’ at the end of character array ?
and in the below code:
char a[100];
cin>>a;
cout<<a;
does the complier by default sees null at the end in the input ? as we do not get any garbage value inthe output…
when are we supposed to give ‘\0’ at the end of character array ?
and in the below code:
char a[100];
cin>>a;
cout<<a;
does the complier by default sees null at the end in the input ? as we do not get any garbage value inthe output…
char a[100];
cin>>a;
in this by default the complier sees null at the end…
‘\0’ is used while reading a char array and when length is unknown…
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.