C by example / Noel Kalicharan.
By: Kalicharan, Noel
.
Material type:
BookSeries: Cambridge computer science texts ; 29.Publisher: Cambridge ; New York : Cambridge University Press, 1994Description: xviii, 362 p. : ill. ; 24 cm.ISBN: 0521450233; 0521456509 .Subject(s): C (Computer program language)| Item type | Current library | Call number | Copy number | Status | Barcode | |
|---|---|---|---|---|---|---|
| General lending | MTU Bishopstown Library Lending | 005.133 KAL (Browse shelf(Opens below)) | 1 | Available | 00006400 |
Browsing MTU Bishopstown Library shelves, Shelving location: Lending Close shelf browser (Hides shelf browser)
Enhanced descriptions from Syndetics:
C is one of the most popular programming languages today. It is flexible, efficient and highly portable, and is used for writing many different kinds of programs, from compilers and assemblers to spreadsheets and games. This book is based on ANSI C - the recently adopted standard for the C language. It assumes familiarity with basic programming concepts such as variables, constants, iteration and looping, but covers all aspects of C. In general it is as much about learning programming skills as it is about mastering the art of coding programs in C. To this end the text contains a wealth of examples and exercises that foster and test the understanding of the concepts developed in each chapter. An outstanding feature of this book is a treatment of 'pointers'. The topic is presented in a clear, logical and reasoned manner that is easy to follow. Binary files and random access files are also treated in such a manner that the reader can easily become adept at using them. Anybody who wishes to get to grips with the art of programming in C will find this a most valuable book.
Includes index.
Getting started with C -- More control structures and arrays -- Functions - the basics -- Character Handling -- Functions and Pointers -- Data Types, Operators and Storage Classes -- Basic structures and linked lists -- Binary trees and other structures -- Standard Input/Output -- File Input/Output -- Miscellaneous topics.
Table of contents provided by Syndetics
- Preface (p. xv)
- 1 Getting Started With C (p. 1)
- 1.1 The first example (p. 3)
- 1.1.1 Running the program (p. 4)
- 1.1.2 A word on program layout (p. 6)
- 1.2 Comments (p. 8)
- 1.3 Data types (p. 9)
- 1.4 Identifiers (p. 11)
- 1.5 Expressions (p. 13)
- 1.5.1 Arithmetic operators (p. 13)
- 1.5.2 Assignment operators (p. 14)
- 1.5.3 Relational operators (p. 15)
- 1.5.4 Logical operators (p. 16)
- 1.5.5 Increment and decrement operators (p. 17)
- 1.5.6 Mixing operands in an expression (p. 17)
- 1.6 Statements (p. 18)
- 1.7 Standard input and output (p. 19)
- 1.8 The while statement (p. 23)
- 1.9 The if ... else statement (p. 26)
- Exercises 1 (p. 30)
- 2 More Control Structures and Arrays (p. 32)
- 2.1 The for statement (p. 32)
- 2.2 The do ... while statement (p. 36)
- 2.3 The switch statement (p. 40)
- 2.4 The continue statement (p. 42)
- 2.5 Arrays (p. 43)
- 2.5.1 Strings (p. 48)
- 2.5.2 Sequential and binary search (p. 50)
- Exercises 2 (p. 52)
- 3 Functions - the Basics (p. 55)
- 3.1 An example - factorial (p. 55)
- 3.2 Function definition (p. 60)
- 3.3 Sequential search (p. 61)
- 3.4 Binary search (p. 63)
- 3.5 The One-Zero game (p. 64)
- Exercises 3 (p. 72)
- 4 Character Handling (p. 76)
- 4.1 Character sets (p. 77)
- 4.2 getchar and putchar (p. 79)
- 4.3 Example - letter frequency count (p. 83)
- 4.4 Strings (arrays of characters) (p. 86)
- 4.5 Example - word frequency count (p. 93)
- 4.5.1 Hashing (p. 94)
- 4.5.2 Back to the problem (p. 98)
- 4.5.3 Insertion sort (p. 106)
- 4.5.4 Sorting the words (p. 110)
- 4.5.5 Printing the table (p. 111)
- Exercises 4 (p. 118)
- 5 Functions and Pointers (p. 120)
- 5.1 Parameter passing (p. 120)
- 5.2 Pointer variables (p. 125)
- 5.3 More on parameter passing (p. 129)
- 5.3.1 A voting problem (p. 131)
- 5.4 Character pointers (p. 139)
- 5.5 Pointer arithmetic (p. 141)
- 5.6 Pointers to functions (p. 145)
- 5.7 Near, far and huge pointers (p. 149)
- 5.8 Recursion (p. 150)
- 5.8.1 An example - Towers of Hanoi (p. 151)
- 5.8.2 An example - decimal to binary (p. 153)
- 5.8.3 An example - quicksort (p. 153)
- Exercises 5 (p. 157)
- 6 Data Types, Operators and Storage Classes (p. 160)
- 6.1 Data types (p. 160)
- 6.2 Operators (p. 164)
- 6.3 Bit operators (p. 167)
- 6.4 Conditional expressions (p. 170)
- 6.5 Storage classes in C (p. 171)
- 6.5.1 automatic (p. 172)
- 6.5.2 external (p. 173)
- 6.5.3 static (p. 177)
- 6.5.4 register (p. 179)
- 6.5.5 Other scope rules (p. 179)
- 6.6 Initialization (p. 180)
- 6.6.1 Simple variables (p. 180)
- 6.6.2 Array variables (p. 181)
- 6.6.3 Two-dimensional arrays (p. 184)
- Exercises 6 (p. 185)
- 7 Basic Structures and Linked Lists (p. 187)
- 7.1 The voting problem revisited (p. 187)
- 7.1.1 typedef (p. 189)
- 7.1.2 Passing structures to functions (p. 192)
- 7.2 Pointers to structures (p. 201)
- 7.3 Linked lists (p. 202)
- 7.3.1 Dynamic storage allocation - malloc, calloc, sizeof (p. 204)
- 7.3.2 Building a linked list - version 1 (p. 208)
- 7.3.3 Some characteristics of linked lists (p. 210)
- 7.3.4 Building a linked list - version 2 (p. 211)
- 7.3.5 Deletion from a linked list (p. 213)
- 7.3.6 Building a linked list - version 3 (p. 214)
- Exercises 7 (p. 217)
- 8 Binary Trees and Other Structures (p. 221)
- 8.1 Binary trees (p. 221)
- 8.1.1 Representing a binary tree (p. 228)
- 8.1.2 Binary search trees (p. 228)
- 8.2 A cross-reference program (p. 233)
- 8.3 Initialization of an array of structures (p. 243)
- 8.4 Nested structures (p. 244)
- 8.5 Unions (p. 245)
- 8.6 Bit-fields (p. 250)
- Exercises 8 (p. 253)
- 9 Standard Input/Output (p. 256)
- 9.1 stdin, stdout, stderr (p. 256)
- 9.2 I/O routines (p. 257)
- 9.3 Text and binary files (p. 258)
- 9.4 Functions for standard input/output (p. 259)
- 9.4.1 getchar and putchar (p. 259)
- 9.4.2 gets and puts (p. 259)
- 9.4.3 printf (p. 260)
- 9.4.4 scanf (p. 268)
- Exercises 9 (p. 277)
- 10 File Input/Output (p. 279)
- 10.1 Internal vs external file name (p. 279)
- 10.2 fopen and fclose (p. 280)
- 10.3 getc and putc (p. 284)
- 10.4 File processing example - telephone charges (p. 285)
- 10.5 feof and ferror (p. 290)
- 10.6 fgets and fputs (p. 291)
- 10.7 sprintf and sscanf (p. 295)
- 10.8 Input/output for binary files (p. 296)
- 10.8.1 fread and fwrite (p. 296)
- 10.9 Random access files (p. 300)
- 10.9.1 rewind and fseek (p. 300)
- 10.9.2 Indexed files (p. 303)
- 10.9.3 Updating a random access file (p. 312)
- Exercises 10 (p. 318)
- 11 Miscellaneous Topics (p. 320)
- 11.1 The C preprocessor (p. 320)
- 11.1.1 The #define directive (p. 321)
- 11.1.2 The #undef directive (p. 333)
- 11.1.3 The #include directive (p. 333)
- 11.1.4 Conditional compilation - #if, #elif, #else, #endif directives (p. 333)
- 11.2 Command-line arguments - argc and argv (p. 335)
- 11.3 Two-dimensional arrays (p. 337)
- 11.3.1 Matrix multiplication (p. 339)
- 11.3.2 Magic squares (p. 340)
- 11.4 Enumerated types - enum (p. 344)
- 11.5 The goto statement (p. 349)
- 11.6 const and volatile (p. 349)
- Exercises 11 (p. 350)
- Appendices
- A List of C keywords (p. 353)
- B Differences between ANSI C and traditional C (p. 354)
- C ASCII character set (p. 357)
- Index (p. 359)