aaronk42
01-22-2004, 01:19 PM
Hi. I'm writing a program that's reading characters from a file, formatting them, and just outputting them to the screen. (Like I said, new to C.)
Here's a piece of code:
while (ch != EOF)
{
printf("%s", &ch);
ch = fgetc(infile);
}
My program works perfectly EXCEPT that it's printing a space after every character. So rather than
*Blue pencil*
as output, I get
* B l u e p e n c i l *
Annoying. Suggestions? Thanks.
Here's a piece of code:
while (ch != EOF)
{
printf("%s", &ch);
ch = fgetc(infile);
}
My program works perfectly EXCEPT that it's printing a space after every character. So rather than
*Blue pencil*
as output, I get
* B l u e p e n c i l *
Annoying. Suggestions? Thanks.