From the web I understand that C contains NUL keyword.
NUL
But while compiling I get an error
NUL undeclared first use in this function\' >
No, that's not standard. Add this at the beginning of your code or just use 0:
0
#define NUL 0
I infered you're not looking for NULL since you're doing ch == NUL
NULL
ch == NUL
In various texts it is quite frequent to refer to '\0' as NUL.
'\0'