c – How does one represent the empty char?
c – How does one represent the empty char?
You can use c[i]=
or simply c[i] = (char) 0
.
The null/empty char is simply a value of zero, but can also be represented as a character with an escaped zero.
You cant store no character in a character – it doesnt make sense.
As an alternative you could store a character that has a special meaning to you – e.g. null char