jacob navia said:
Upthread, you said:
"Download the tutorial.pdf. It has a complete description of C"
The tutorial says:
"this is not a full-fledged introduction to all of C." and "there isn't here
a description of all the features of the language".
I spot a contradiction, don't you?
Anyway, here are the next half-dozen bugs for you. But you might find it
easier to find someone who knows C, and get them to go through the whole
thing, fixing all the bugs in one fell swoop.
Minor nit: on page 16, strictly speaking the argument to your printf call is
the result of evaluating "Hello\n" - and that result is a pointer, not a
string.
Medium nit: merely saying that the return value from main is optional is to
miss an opportunity to explain why main returns a value, and what that
value is used for.
Medium nit: For int fn(int a) on page 18, you claim that a is an argument.
It isn't. It's a parameter. You continually confuse the two in your
tutorial.
Major nit: you claim on page 19 that, when you see a statement like
printf("Hello\n"); the address of the first element is passed to printf
(which is true), but you then say that "the array can be modified by the
function you are calling". But the printf function takes const char * as
its first parameter. It cannot modify the array whose first element's
address is passed, except by violent means, such as casting away the
constness.
Medium nit: compilers exist which pre-date C99 and for which their
implementors, at the time of release, correctly claimed conformance to ANSI
C. On page 22, you give a list of headers which *all* "ANSI compliant" C
compilers provide. So a reader, learning C from your tutorial but using an
early Borland or Microsoft compiler, is going to be very confused by your
list. They will also be thrown by your occasional for(int i = ...) code.
Major nit: On page 24, "char *argv[] This is an array..." It isn't. It's a
pointer.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.