No, it's not good. It's a mess. This (constchar *) '\n' creates a pointer that is pointing at the memory address 0x0000000a. It does NOT create a pointer that is pointing at memory containing the character '\n'. This reveals that you don't have a solid understanding of what a pointer is, which is definitely something to fix.
Ignoring the mess of this const char* cast, you're comparing pointers. You're not comparing characters. You're comparing two memory addresses.
If you had one char* that pointed to the string "beans" somewhere in memory, and another char* that pointed to the string "beans" somewhere else in memory, what do you think the result of this is?
first_char_pointer == second_char_pointer;
I'll tell you. The result is false.
Your code is fundamentally wrong because you think you're comparing strings, but actually you're checking to see if two pointers point at the exact same place in memory.