I want to read a stream of characters from standard input whose length is unknown. I am trying to read character by character as
#include <stdio.h>
int main(void)
{
char ch;
do
{
scanf("%c",&ch);
//do some comparison of ch
}while(ch!='');
return 0;
}
Help me write the condition in while so that I can read input properly without entering into an infinite loop
Sample input:
abcdefghijklmnop