0% found this document useful (0 votes)
64 views5 pages

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

The document provides an overview of sections from Chapter 1 of the C programming language book by Kernighan & Ritchie. It discusses creating and running simple programs like Hello World. It also covers variables, data types, arithmetic operations, loops, functions like printf, and symbolic constants. Additional topics include character streams, file input/output using functions like getchar() and putchar(), and file redirection in UNIX.

Uploaded by

vimal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views5 pages

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

The document provides an overview of sections from Chapter 1 of the C programming language book by Kernighan & Ritchie. It discusses creating and running simple programs like Hello World. It also covers variables, data types, arithmetic operations, loops, functions like printf, and symbolic constants. Additional topics include character streams, file input/output using functions like getchar() and putchar(), and file redirection in UNIX.

Uploaded by

vimal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 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