Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search

Thinking in C CD Rom Table of Contents, (c) 1999 MindView, Inc.

Thinking in C
Foundations for Java and C++
by Chuck Allison
© 1999 MindView, Inc. http://www.MindView.net

Note: Please click hereif you haven't performed the installation. Please read the copyright notice.

 
Table of Contents
Chapter 1: Introduction and Getting Started
Chapter 2: Fundamental Data Types
Chapter 3: Operators
Chapter 4: Controlling Program Flow
Chapter 5: Compound Data Types
Chapter 6: Programming with Functions
Chapter 7: Pointers 101
Chapter 8a: A first look at Java (if you're going on to Java)
Chapter 8b: Pointers 102 (if you're going on to C++)
(There is no "Chapter 9a", since it is not necessary for Java)
Chapter 9b: A first look at C++
Where to go next ...
Technical support
Source code from examples, exercises and solutions
Compilers
 

Chapter 1: Introduction and Getting Started
40 Minutes and 16 seconds
Start Lecture
Back to Table of Contents

This chapter gives the context for the course (you know some programming) and clarifies course objectives (find the shortest, most effective path to Java and C++). We take a first look at C programming by examining statements, comments, include files, and standard I/O streams.


Chapter 1 Exercises

Compile and execute two sample programs (A full description is given at the end of the main lecture).

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
first.c avg.c Other options for source code

Chapter 1 Exercise solution lecture

Here are the source-code files for the exercise solutions:
avg.out

Back to Table of Contents

 

Chapter 2: Fundamental Data Types
40 Minutes and 25 seconds
Start Lecture
Back to Table of Contents

Like most languages, C has two flavors of numeric data types: integers and real numbers. Unlike most languages, they come in an array of different sizes. This chapter explores the limits and behavior of C's built-in types and explains converting from one type to another both implicitly and explicitly (i.e., casting).


Chapter 2 Exercises

Rounding to nearest integer.(A full description is given at the end of the main lecture).

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
float.c limits.c missing.c Other options for source code

Chapter 2 Exercise solution lecture

Here are the source-code files for the exercise solutions:
lab2.c

Back to Table of Contents

 

Chapter 3: Operators
21 Minutes and 22 seconds
Start Lecture
Back to Table of Contents

C has more operators than most languages. Most are binary operators, some are unary, and there's even a ternary operator (a what? :-). Since C is among other things a systems language, there are operators that access features close to the machine. In this chapter we cover all but five operators (those are covered in later chapters). You'll also see the way operators work together.


Chapter 3 Exercises

Test the parity (i.e., even-ness/odd-ness) of input numbers. (A full description is given at the end of the main lecture).

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
bitwise.c Other options for source code

Chapter 3 Exercise solution lecture

Here are the source-code files for the exercise solutions:
lab3.c

Back to Table of Contents

 

Chapter 4: Controlling Program Flow
23 Minutes and 48 Seconds
Start Lecture
Back to Table of Contents

In 1968 a pair of mathematicians proved that all algorithms could be expressed by three simple mechanisms (coupled with an arbitrary number of boolean (logical) flags):

  1. Sequences of statements
  2. Decision-making
  3. Repetition

This chapter shows how to use these in C and then some.


Chapter 4 Exercises

Repeat the exercise in Chapter 3 on an arbitrarily large number of integers. (A full description is given at the end of the main lecture.)

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
age.c age2.c branch.c Other options for source code

Chapter 4 Exercise solution lecture

Here are the source-code files for the exercise solutions:
lab4.c lab4a.c

Back to Table of Contents

 

Chapter 5: Compound Data Types
35 Minutes and 19 Seconds
Start Lecture
Back to Table of Contents

You can only go so far with numbers. Programming gets interesting when you create complex data types from simpler ones. This chapter discusses arrays (in all dimensions!), illustrates text processing with character strings, and shows you how to create complex data types of your own.


Chapter 5 Exercises

Create and process a collection of employee records. (A full description is given at the end of the main lecture.)

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
2d.c 3d.c 3d2.c reverse.c strings.c struct.c struct2.c Other options for source code

Chapter 5 Exercise solution lecture

Here are the source-code files for the exercise solutions:
lab5.c

Back to Table of Contents

 

Chapter 6: Programming with Functions
40 Minutes and 38 Seconds
Start Lecture
Back to Table of Contents

Functions are the building blocks of real-world C programs. Here you'll learn about value semantics, the void type, function prototypes, and the scope (visible region) of identifiers. You'll also come to understand storage class, modularity, and information hiding, which is a key principle of object-oriented programming.


Chapter 6 Exercises

Divide the employee program into modules, separating interface from implementation. (A full description is given at the end of the main lecture.)

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
employee.h file1.c file2.c fun1.c fun2.c fun3.c lab6.c scope.c stack.c stack.h static.c tstack.c Other options for source code

Chapter 6 Exercise solution lecture

Here are the source-code files for the exercise solutions:
employee.c employee.h lab6.c

Back to Table of Contents

 

Chapter 7: Pointers 101
44 Minutes and 55 Seconds
Start Lecture
Back to Table of Contents

Pointers are key to effective systems programming and for implementing complex objects in C++. But if you're going on to Java, you don't need all that machinery. But you do need some basics, because even Java uses pointers (but in a much more restricted way). This chapter covers the minimum so you can move on to Java: indirection, reference semantics, and using the heap (dynamic memory).


Chapter 7 Exercises

Exercise: modify the employee program to handle dynamic employee records. (A full description is given at the end of the maine lecture.)

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
echo.c employ2.h indirect.c lab7.c reverse2.c structarg.c swap.c Other options for source code

Chapter 7 Exercise solution lecture

Here are the source-code files for the exercise solutions:
employ2.c employ2.h lab7.c

Back to Table of Contents

 

Chapter 8a: A first look at Java
46 Minutes and 27 Seconds
Start Lecture
Back to Table of Contents

You made it! If you're not interested in C++, this is your final stop. Here we look at how Java programs are coded and built, and more importantly, how the Java Runtime Environment works. We also look at control flow and how to create objects and arrays.


Chapter 8a Exercises

Exercise: implement a simple Stack class (first seen in Chapter 7). (A full description is given at the end of the main lecture.)

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
Array1.java Array2.java Array3.java Average.java Employee.java Hello.java Label.java Limits.java Other options for source code

Chapter 8a Exercise solution lecture

Here are the source-code files for the exercise solutions:
Stack.java

Back to Table of Contents

 

Chapter 8b: Pointers 102
1 Hour, 19 Minutes and 28 Seconds
Start Lecture
Back to Table of Contents

No, if you're going to navigate real C++, you're not done yet! First you have to become familiar with multiple levels of pointer indirection, pointer arithmetic, making objects read-only via const, generic pointers (void*), and the relationship pointers have with arrays and functions.


Chapter 8b Exercises

  1. Write a function that inspects any object.
  2. Totally hide the Employee implementation in an incomplete type.
  3. Define and use a pointer within a 4-dimensional array (optional, but recommended!).

(A full description is given at the end of the main lecture.)

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
bitwise2.c fptr.c fptr2.c parith.c parray.c pptr.c qsort.c stack8b.c stack8b.h ulimits.c Other options for source code

Chapter 8b Exercise solution lecture

Here are the source-code files for the exercise solutions:
employ2.c employ2.h lab8-1.c lab8-2.c lab8-3.c

Back to Table of Contents

 

Chapter 9b: A first look at C++
36 Minutes and 29 Seconds
Start Lecture
Back to Table of Contents

Relax, it's all downhill from here (until you take your full-blown C++ class :-)! This chapter explains key differences between C and C++, and takes you through three key C++ features:

  1. Type safety
  2. Classes
  3. Templates

Also covered are IOStreams and the free store operators new and delete.


Chapter 9b Exercises

Implement a complete Employee class. (A full description is given at the end of the main lecture.)

Here are the source-code files for the exercises (use these as a starting point for solving the exercises):
hello.cpp intstack.cpp intstack.h stack9b.h tintstack.cpp tstack9b.cpp Other options for source code

Chapter 9b Exercise solution lecture

Here are the source-code files for the exercise solutions:
employee.cpp employee.h lab9.cpp

Back to Table of Contents

 

Where to go next ...

Now that you have enough of an understanding of C, you're ready to move on to your new language of choice: C++ or Java. MindView, Inc. has more resources available for you to learn these languages, including a variety of seminars, training CD Roms like this one, and both of Bruce Eckel's award-winning, freely downloadable books Thinking in C++ and Thinking in Java. Be sure to visit http://www.MindView.netto download your copies of the books, and to learn about the other seminars and CDs!

Back to Table of Contents

 

Source Code
Back to Table of Contents

You have several options for accessing the source code for all the slides, exercises and solutions. The hyperlinks shown above for all the files in each chapter go to HTML files which can be cut and pasted directly from your browser into your editor or compiling environment. This is a bit tedious, but it works.

All the code files are also available in the subdirectory "solution" on this CD ROM. There, you'll find subdirectories for each of the lectures and solutions.

The most convenient form is a ZIP filecontaining all the source code, which can be copied directly to your hard disk and unzipped; the unzipping process will create all the appropriate files and directories. If you don't have an "unzip" program on your machine,the best place to go for tools is http://www.cdrom.com/pub/infozip/. This is a freeware, open-source implementation of zipping and unzipping programs that work on virtually all platforms. It's also what I use to zip the files. This CD ROM contains a version of INFO-ZIP for 16 & 32 bit DOS and the Macintosh, in the subdirectory Info-Zip. Here are the readme files for dos and the Macintosh.

All questions about INFO-ZIP should be directed to the creators of that program; the INFO-ZIP material is only being included as a convenience and is not an official part of the Thinking in C CD Rom. Info-ZIP's software (Zip, UnZip and related utilities) is free, and can be obtained as source code or executables from Internet/WWW sites, including http://www.cdrom.com/pub/infozip/).

Please note: when unzipping (using the above program) for Unix/Linux platforms, remember to use the -a flag, which will correct all the CR/LF issues during the unzipping process.


Compilers
Back to Table of Contents

This CD Rom does not include any compilation tools for C, C++ or Java. It is your responsibility to acquire and install the tool of your choice. See here for more details.

 

Technical support
Back to Table of Contents

If you have a problem you cannot resolve, Please first look at the FAQ. If this does not solve your problem, then go to the support site at http://www.FreshSources.com.

Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.