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 015 to 016 - 7.54% Completion

1.5 Character Input and Output

Input and output supported by the standard library: Text is treated like a stream of characters. What is called a text stream is a sequence of characters divided into lines. Each line consists of zero or more characters followed by a newline character. It is the responsibility of the library to make sure the printing is done properly.  

The Standard Library has functions that read / write one character at a time, of which getchar and putchar are the least complex.


Every time getchar is called it reads the next input character from a text stream and returns that as its value.


c = getchar()

causes the variable c to contain the next character of input. 

putchar (c)

prints the contents of the integer variable c as a character

Calls to putchar and printf may be mixed, The output will be printed in the order in which the calls are made.

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 05:46 am
Powered by Dreamwidth Studios