Hi Eugene,

    1. You frequently refer to RAM as core. I think this is an outdated
    term, and many modern programmers may not know what it means. I
    would suggest replacing core with RAM or main memory.

Thanks for the suggestion.  Isn't the meaning clear from the context?
But I'll suggest to rms that we change the term, anyway.

          c = getchar();
     while (c != EOF)
          {
       write(file_descriptor, &c, 1);
            c = getchar();

Actually, the 5.3 section you refer to talks specifically about
if-conditions.  Not while-conditions.  Assignments in while-conditions
are ok (as far as I know), precisely to avoid the kind of code
duplication you had to write above.

However, there should be a space after "write" and "getchar", per 5.1 :).

    b. It would be good to include the correct way of doing what the
    code should be doing. This way, the reader may learn better from
    this example. :)

True enough.  I have to shame-facedly confess that I'm not sure of the
recommended way to write it.  Introduce a char variable, like the below?
Use a cast somehow?  Paul?

     int c;
     ...
     while ((c = getchar ()) != EOF)
       {
         char c_for_write = c;
         write (file_descriptor, &c_for_write, 1);
       }

Thanks for writing,
Karl


Reply via email to