![]()       Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search |
Thinking in C
Foundations for Java and C++
by Chuck Allison
© 1999 MindView, Inc. http://www.MindView.netNote: Please click hereif you haven't performed the installation. Please read the copyright notice.
Chapter 1:
Introduction and Getting Started 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): Chapter 1 Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 2:
Fundamental Data Types 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): Chapter 2 Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 3:
Operators 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): Chapter 3 Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 4:
Controlling Program Flow 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):
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): Chapter 4 Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 5:
Compound Data Types 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): Chapter 5 Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 6:
Programming with Functions 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): Chapter 6 Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 7:
Pointers 101 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): Chapter 7 Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 8a: A
first look at Java 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): Chapter 8a Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 8b:
Pointers 102 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
(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): Chapter 8b Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
Chapter 9b: A
first look at C++ 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:
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): Chapter 9b Exercise solution lecture Here are the
source-code files for the exercise solutions: |
|
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! |
|
Source Code 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 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 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. |