How does c compare character variable against string?
The following code is completely ok in C No, Not at all. In your code if(ch==”a”) is essentially trying to compare the value of ch with the base address of the string literal “a”,. This is meaning-and-use-less. What you want here, is to use single quotes (‘) to denote a char literal, like if(ch == … Read more