just a piece of advice: try to get a tutorial on C strings.
getch() return a *single* character (at least in standard environment. Don't reuse standard name if you don't follow standard or noone will be able to help you).
a single character is a small integer (0x41 is for 'A', 0x20 for space, etc). A string is a pointer to an array of character, terminated with a null character '\0'.
so
Code:
char this_is_a_string[]={'H','e','l','l','o',0};
char *this_is_also_a_string="Hello";
are two way to declare the string "Hello" in C.
as "&&" is the logical AND operator, getch && '\0' is an always false expression (as '\0' is 0 thus false, and "anything AND false == false")
in no way getch && '\0' is a concatenation. there's no concat operator in C.
getch() && "\0" is "getch() didn't returned a nul character and "\0" is different from the NULL pointer" .which is ... at least hard to guess... but shouldn't compile without a bunch of warnings ...
what you want to do is :
Code:
char tmpstr[2]={0,0};
tmpstr[0]=getch();
printk(tmpstr);