This is part of a larger program to emulate the cat command in unix. Right now trying to take input and send it to stdout:
char in[1000];
int c = 0;
while ((c = getchar()) != EOF)
{
fgets(in,1000,stdin);
fputs(in, stdout);
}
This sends output to stdout, but in every case it skips the first letter. For instance, if I type the word Computer
I get back:
omputer
while (fgets(in,1000,stdin))
and don't forget to remove thefgets
in the body of thewhile
loop. – Evanswhile (fgets(...) != NULL)
– Normalcy