Let us start exploring the particularities of the C Programming Language
with something familiar; a loop, some input /output operations, some IF
statements and some arithmetics. Our first program will average a variable-length
series of integer grades and open the discussion on the steps used in C
development environments to translate a plain-text source file into an executable
file. When we are done, we will take a look at the various traps and pitfalls
which await novice C programmers in the statements and tools we explored so far.
These modules rely on Nick Parlante's "Essential C" tutorial to provide you with a
written reference to the language. Our videos and exercises are building on this
lecture-like exposition to the language to provide you with a complementary hands-on way to learn it.
Make sure you start a module by the suggested readings we provide here.
For this first module, you should read the following sections of the EssentialC PDF document;
Introduction - Just to have some background about the programming language we are studying
Section #1 - Basic Types and Operators
Section #2 - Control Structures
While we provide a PDF version of the above-mentioned tutorial, you might want to follow the above link to
Nick Parlante's web site and download the latest version and peruse the excellent material available there.
If you are already familiar with Java or C++, you will find that the syntax of the main
Execution Flow Control statements is the same. This video will illustrate the solving of
a novice programmer problem, averaging a series of integer grades entered by the user, by
leveraging the C Programming Language syntax.
Video Duration - 14"32 / Development Environment - Linux
Our first example showed how we compiled, linked and ran a simple program in a command line environment.
Such environments are good at exposing the various steps of the process leading from a text file to an executable file.
However, the gcc tool we used is in fact piloting a few tools during a multi-step process which we are going to detail
in this mini-lecture. Along the way, we explain in simplified terms what are the various components of the Compiler and how they
are chained with one another (pre-compiler, compiler, assembler and linker). This knowledge will be handy when
we are tracking down errors which might arise from a specific step of this process.
Immunization. Let us make some errors on purpose so we learn how the compiler / linker / runtime environment reacts to them,
what are the symptoms revealing them, why are they even errors to start off with, ...
It is better for you to learn about novice errors in a controlled environment, i.e. a few lines long programs,
rather than facing the most subtle ones in a few thousands lines authored by several programmers.
The best way to learn programming is by... programming. Same goes with learning a new language.
The material in this folder illustrates some "experimentations" with the language. Their purpose
is to get you used to learning a new language by writing small programs aimed at demonstrating some of its
features / properties / weirdnesses.
Make sure you have your development environment at the ready when watching these videos so you may replicate the
experiments and, even better, test out some variants of your own to help you understand.