C Tutorial (I) : Kernighan & Ritchie, Chapter 1, Sections 1.1-1.5

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 5

C Tutorial (I)

Kernighan & Ritchie, Chapter 1, Sections 1.1-1.5

Section 1.1
To create programs, use the text editor subEthaEdit, which should be available in the Applications folder of your classroom machine.If this application does not already appear in your Dock, it is suggested that you insert it (just drag the application to the Dock). To compile your code, use cc just as shown by the authors. Create and run the venerable Hello World example. (If youve ever wondered where every programming book in the world got the Hello Word example from, look no further!)

Sect 1.2
Create, compile and run the temperature converter examples. Be sure you understand the concepts:
Variable type Assignment statement How arithmetic results vary depending on variable type How loops work printf
Its role as a standard library function How formatting strings work Special (escaped) characters

Sect. 1.3
Understand the additional details about the for statement highlighted in the example.

Sect. 1.4
Understand how to define and use symbolic constants.

Section 1.5.1
Understand the concept of character stream. Compile and test the file-copying example. Understand how getchar() and putchar() are used. Understand how EOF works. Learn how file redirection is implemented in UNIX (>,<), and to use this to accomplish file copying with the sample code in 1.5.1 (this will be discussed in class).

You might also like