Book Reviews


Programmer's Guide To Turbo C 2.0

Reviewed By Robert J. Sparks


Robert Sparks is a Ph.D. student in mathematics at Texas A & M University where he has managed their UNIX and PC systems for several years. He may be contacted at P.O. Box 14383, College Station, TX 77841.

Chao C. Chien's Programmer's Guide To Turbo C 2.0 is another brick in the wall of C tutorial books. Since Kernigan and Ritchie's The C Programming Language contains information so dense and unsuperfluous, I usually recommend that a novice C user supplement it with a tutorial that matches his personality. Chien's book might be the choice for those who learn by example.

The author assumes that C is not the reader's first programming language. In fact, he suggests that the reader should have a good background in basic computer science, two or more programming languages under his belt, and maybe some experience with assembly language. He draws on this knowledge to describe the structure of C.

Chapter one contains instructions for installing Turbo C and a sample programming session. Instead of using the INSTALL program supplied with Turbo C 2.0, Chien provides a list of commands to put the compiler on a hard disk by brute force. He then walks the reader through the steps of editing, compiling and running a simple C program with key-by-key instructions. Unfortunately, this first program's source code is missing a critical space in a declaration. This error occurs often in the first five chapters.

intn1, n2, n3;
Chien then launches into a basic description of C. He begins with data types, explaining variable initialization and arrays. He moves on to basic I/O, emphasizing printf. Flow control follows with many examples of looping, branching and function calls, including several that emphasize the difference between pass-by-value and pass-by-reference. These chapters read easily and are flawed only by typesetting errors in the examples and a short, unclear section on the union data type.

Chien veers away from C with a chapter on top-down design aimed at BASIC programmers. Chien presents the advantages of modular design and function libraries and gives an example of using the Turbo C project builder. The focus returns to C with a discussion of variable scope and extent, the preprocessor and pointers.

After an example-filled tour of library routines (including several graphics functions), there is a lengthy discussion of the struct data type, including detailed examples of designing, declaring, and using structures. The book presents the mechanics of passing a structure to a function and explains the alternate syntax for passing structure pointers. Chien develops a linked list and then an insertion sort using structures. The example programs are good until the last in chapter 20, which is long, presented with very little description, and is plagued with typesetting errors. Of the six #include statements, only one came through with the filename intact.

File I/O is presented with examples of both sequential and direct file access. These chapters are short, straightforward and contain a set of programs which use window-based data entry, structs for data storage, and direct access I/O to keep track of employee information.

Chien finishes the book with examples of interfacing to the BIOS, linking in assembly language functions, generating inline assembly code, and interfacing with MS-DOS.

I question whether Mr. Chien had a clear concept of his audience when he put this book together. The level of presentation shifts between that of introductory textbooks to that of spreadsheet or word processor cookbooks. This fact combined with the strange placement of some of the chapters made the book hard to follow. When the errors in the example listings are added, the book can be downright confusing to a novice C programmer.

There are some strong points however. The book does have a large number of simple examples. Someone who is an accomplished programmer in another language could use these examples as a kind of toolkit for quick ports of their code to C. But even for such a reader, this book should be backed up with Kernighan and Ritchie's The C Programming Language.

Programmer's Guide To Turbo C 2.0
Chao C. Chien
Bantam Computer
$22.95, 299 pages.