Hacker News new | ask | show | jobs
by vole 3069 days ago
>Yet there's still one small simplification that can be made: the condition in the inner loop doesn't need "!= '\0'".

I believe this would cause the newline not to be printed in the unknown command error, so it is necessary.

1 comments

How? '\0' is the same value as 0 (only with a different type, which doesn't matter in this case), and if(x != 0) is the same as if(x).
> a different type

This is true in C++ but not in C.