I am using Ubuntu 12.04 LTS with gcc. Can anyone tell me, how can this character type variable hold more than one byte? NOTE : This program will echo all characters(more than one) you type. For instance, if u type "thilip", then it will echo as "thilip". each character holds 8-bits(one byte), so i have typed 6 character (6 bytes). Then, How can getchar function assign this value to character type variable which can hold only one byte?
#include <stdio.h>
int main(void)
{
char ch;
while ((ch = getchar()) != '#')
putchar(ch);
return 0;
}