What is the difference between using (char)0 and \'\\0\' to denote the terminating null character in a character array?
(char)0
\'\\0\'
Character array means You are taking String so I advise you to use '\0' at the end of character Array after reading all the Characters of from user because 0 is simple Character but '\0' is NULL which indicates end of String.
'\0'
0
NULL