sorcerer_see: (Default)
PS I synthesize here in my own words what K&R teach, re-write all their example programs, character by character, solve all the C exercises they hand out. I comment to what K&R teach cursively. I do not copy-paste anything from the book! In regards to the percentages listed: books often have prefaces with Roman numbers and often also lengthy Appendices. In my calculation I include all pages that I effectively study and synthesize.

TCPL 2Ed - Page 016 - 7.54% Completion

1.5.1 File copying

With only getchar and putchar a lot of useful ode can be written. One simple example of it's possibilities: a program that copies its input to its output one character at a time:

This program reads a character and, as long as end of file is not reached, outputs the character just read and reads the next character.

k-r_exp-p16-1.c


k-r_exp-p16-1.out


The symbol !=, used in the program, is a relational operator meaning "not equal to"

What we call a character on a screen is of course, like all other appearances on the screen stored in the computer as patterns of bits. Type char is meant to store character data, but any integer type can be used.

Profile

sorcerer_see: (Default)
sorcerer_see

October 2025

S M T W T F S
    12 34
56 7 8 9 10 11
12 1314 15 16 1718
19 2021 22 23 2425
2627 28293031 

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 16th, 2026 10:02 am
Powered by Dreamwidth Studios