D
Dan Pop
In said:Yes, I could - using vim, or emacs, or ed, or less, or joe, or pico, or even
grep! Or I could simply write a simple cat:
#include <stdio.h>
int main(void)
{
int ch;
while((ch = getchar()) != EOF)
{
putchar(ch);
}
return 0;
}
You see, text fits in with the C model very well indeed. It's easy to write
text processors in C.
Especially if they're not supposed to work when the text file doesn't
match the author's assumptions. As a trivial example, your program
blisfully ignores character set issues, something that PDF readers usually
get right.
These days, text means more than whatever can be expressed with the
ASCII character set. Or even with any of the ISO-8859 8-bit character
sets.
Dan