jacob said:
You have to scroll down and press "take me to the downloads" button.
This is a hardcopy version, the elec tronic version is free.
....but conveniently for you, sends more people past your
revenue-generating amazon links.
Look, it is a tutorial for C. Since "Standard C" doesn't RUN anywhere
(you need some specific compiler, some specific operating system,
some way of doing windowed output etc) it is a tutorial of
C in a certain context.
This is sheer nonsense. Standard C runs anywhere there is a standard C
implementation. (And you shouldn't write programs which require
"windowed output").
The first part is about standard C,
the second about windows, and the third is about network programming.
The first part presents a fairly complete view of the language.
Here are a few bits I've picked out:
p2: "A program in C is written in one or several text files called
source modules. Each of those modules is composed of functions, i.e.
smaller pieces of code that accomplish some task, and data, i.e.
variables or tables that are initialized before the program starts."
That defines static data, but what about automatic variables and
dynamically allocated data?
p2: "Lisp and scheme, two list oriented languages featured automatic
garbage collection since several decades."
This should be "Lisp and scheme, two list oriented languages, have
featured automatic garbage collection for several decades." (For a
non-native speaker, your english is very good, but your usage of "since"
here is wrong, and you frequently use this incorrect idiom. This will be
the last spelling/grammar criticism from me, since it is offtopic.)
On p18, your example of a typecast is in a position where the cast is
unnecessary:
float f = 67.8f;
double d = (double)f;
On p19 your description of the size of arithmetic types is mostly wrong.
It is true that char is 1 byte (by definition) but it is not true that
short must be 2 bytes, int must be 4, long must be 4 or long long must be 8.
p21: "Machine addresses are just integers, of course. For instance, if
you have a machine with 128MB of memory, you have 134 217 728 memory
locations."
I don't know what you're talking about, but it's not standard C. Machine
addresses are not necessarily "just integers".
p54:
"1.13.10 union.
You can store several values in a single memory location or a group of
memory locations with the proviso that they can’t be accessed at the
same time of course. This allows you to reduce the memory requirements
of a structure, or to interpret a sequence of bits in a different fashion.
For a detailed discussion see “Unions” on page 107."
This isn't very clear. It sounds like I can store multiple variables in
a union simultaneously, provided I don't access them simultaneously.
p57:
"1.13.19 unsigned.
Integer types (long long, long, int, short and char) have the most
significant bit reserved for the sign bit. This declaration tells the
compiler to ignore the sign bit and use the values from zero the 2^n for
the values of that type. For instance, a signed short goes from –32767
to 32767, an unsigned short goes from zero to 65535 (2^16). See the
standard include file <stdint.h> for the ranges of signed and unsigned
integer types."
Why even mention a sign bit? Also while that is the minimum range for a
signed short, it may be larger (and it wouldn't surprise me if it is
larger on lcc-win32!)
p123: C does not require ASCII. You fail to communicate this and
actively mislead your readers by saying the ordering used by strcmp is
based on the ASCII character set.
p134: alloca() is not standard C, but you do not state this. AFAIK
_msize() and _expand are not either.
p138: Are you really advocating writing programs which do not free() all
that they malloc()?
p146: This is a poor hash function, and you do not explain sufficiently
well the importance of a good hash function.
p182: IEEE 754 floating point is not required by the standard.
p190: QFLT_EPSILON is not part of the standard, though it looks like you
state that it is.
Overall, the typesetting is dreadful: on p3, "argument-list" should not
wrap a line. When you introduce main, you italicise it, but when you
introduce printf, you put it in double quotes. On p13, the line numbers
in the second example look like they're part of the code (and cause
syntax errors!) On p18 you have a code example in a proportional font.
On top of all this, there is no Chapter 2!
This is after a quick skim, I haven't read most of it. But what I have
read already means I wouldn't recommend this guide to anyone as an
introduction to standard C. In some places, you take care to inform the
reader what is standard and what is lcc-win32 specific, but in other
places you do not. And your explanations and definitions are sloppy, but
an introduction to C must be strict and careful with its use of words.