When I compare getchar() != '/n' I get the warning: multi-character character constant. I wounder why? I code in C and use gcc as compiler. I thought that getchar read in one character and converted it to int for itself. So what's the meaning of multi-character character constant?
2 Answers
'/n' is 2 characters I think you are looking for '\n'
Getchar() will get 1 char '/n' is 2 characters (and because you defined the characters already it is a constant) so it is a multiple character character constant
'/n' is two characters / and n. Hence multi character. getchar reads one character at a time. i think you want to use line break which is '\n'.