sreya sreya - 1 year ago 74
C Question

How does one represent the empty char?

I'm currently writing a little program but I keep getting this error when compiling

error: empty character constant

I realize it's because I'm trying to replace a valid char with empty space
but I have not been able to find another way to represent it.

Answer Source

You can use c[i]= '\0' 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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download