I'm trying to write a program for an assignment which takes standard input and writes only non-empty lines to standard output. I'm just having a little trouble working out how to do that. This is my code so far
I tried that but when I pass text though it still prints out empty lines.
If I use this code instead is there any way to not get it to putchar empty lines? I looked at if(isspace(c)) and others but nothing seems to do what I want
#include <stdio.h>
int main( void )
{
char c;
while( (c = getchar()) != EOF )
putchar( c );
}