which tutorial to use?

D

doom

R

Richard Heathfield

(e-mail address removed)-a.invalid said:
hello all,

google listed the links below for search "c tutorial".

I've *glanced* at each of these, looking specifically for typical errors
made by tutorial writers.

Hmmm. I tried it in three different browsers and got a blank page in each
of them. But IIRC the answer to this one is simply "no".

Unix-specific, and shows it in places. For example, see:

<http://www.cs.cf.ac.uk/Dave/C/node4.html#SECTION00440000000000000000>

which specifies as written-in-stone some limits that are more to do with
the author's platform than with C.

It has some obvious errors. Consider, for example,
<http://www.le.ac.uk/cc/tutorials/c/ccccpont.html> which claims that "A
pointer is a variable that stores this location of memory." NULL is an
obvious counter-example - it's a pointer, but not a variable.

Obvious error in:
<http://www2.its.strath.ac.uk/courses/c/subsection3_6_3.html#SECTION0006300000000000000>

"Local variables are declared within the body of a function, and can only
be used within that function." Had he only said "used by name"...

Same mistake as above: "A pointer, then, is a special kind of variable".

Recommended.

sorry if this is off topic but there was no other group for C...

It's bang on topic as far as I can see. But your best bet is to buy a copy
of "The C Programming Language", 2nd edition, by Kernighan and Ritchie.
 
I

Ioannis Vranos

Richard said:
Same mistake as above: "A pointer, then, is a special kind of variable".

It isn't?

Recommended.


The above one is also available in PDF format:

http://cprog.tomsweb.net


Has anyone checked it thoroughly? I took a glance and it looks good to me.

int main(void)/int main(int argc, char *argv[]) are used and I like this
accuracy.


However myself am interested in C95 and it says it refers to some C99
things.
 
S

santosh

Ioannis said:
Richard said:
Same mistake as above: "A pointer, then, is a special kind of
variable".

It isn't?

Recommended.


The above one is also available in PDF format:

http://cprog.tomsweb.net


Has anyone checked it thoroughly? I took a glance and it looks good to
me.

int main(void)/int main(int argc, char *argv[]) are used and I like
this accuracy.

It's a pretty good tutorial. But a bit too brief, if you ask me.
However myself am interested in C95 and it says it refers to some C99
things.

C99 is here to stay. Might as well get used to it.
 
R

Richard Heathfield

Ioannis Vranos said:
It isn't?

No. A pointer is a special kind of value. Objects of proper type can store
such values, but constants (e.g. NULL) can be pointers too.
The above one is also available in PDF format:

http://cprog.tomsweb.net
/nod

Has anyone checked it thoroughly? I took a glance and it looks good to
me.

I can't claim to having checked it thoroughly. Having said that, I've
glimpsed through it a number of times, and never once found a mistake in
it. Its author, Tom Torfs, used to be a clc regular. The last I saw of
him, he was asking a question about C preprocessor rules in C99 from an
implementor's perspective - so for the last decade or so he's been
"missing, presumed writing a C99 compiler".

I note that the acknowledgements list (for suggestions, corrections, and
additions) includes Dann Corbit, Lawrence Kirby, and Sunil Rao - all of
whom are highly knowledgeable about C, as is Tom himself. So I'd say that
it's very unlikely to contain any significant errors.
int main(void)/int main(int argc, char *argv[]) are used and I like this
accuracy.


However myself am interested in C95 and it says it refers to some C99
things.

A quick flick through suggests that C99 mentions are very much "in
passing", so to speak. I found a list of new C99 headers, clearly labelled
as such. I think you can just ignore the C99 stuff, really, without
compromising the usefulness of the tutorial.
 
K

Kenny McCormack

It is? I still don't have any compiler that supports it fully.

I don't have any Ada or PL/1 compilers on any of my machines or any
machine I have direct access to.

Therefore, I would assume that those languages don't exist (or are not
"here to stay")


Hint: C99 compilers exist - you just haven't installed one yet.
 
I

Ioannis Vranos

Richard said:
Ioannis Vranos said:


No. A pointer is a special kind of value. Objects of proper type can store
such values, but constants (e.g. NULL) can be pointers too.


You mean, "an address is a special kind of value".

Pointers are special kind of variables that can store addresses.

NULL is a special-meaning pointer (address) value.
 
I

Ian Collins

Randy said:
I didn't say it didn't exist.
No, but you either inferred C99 compilers didn't exist, or made a
pointless post.

I'm perfectly happy with my (free) C99 compiler.
 
I

Ioannis Vranos

Ian said:
No, but you either inferred C99 compilers didn't exist, or made a
pointless post.

I'm perfectly happy with my (free) C99 compiler.


Which is?
 
F

Flash Gordon

Ian Collins wrote, On 09/03/08 21:58:

I'm perfectly happy with my (free) C99 compiler.

So which free C99 compiler are you using? Current gcc versions are only
almost-c99 compilers according to the documentation.

I am aware that some of the commercial compilers conform to C99.
 
I

Ian Collins

Flash said:
Ian Collins wrote, On 09/03/08 21:58:



So which free C99 compiler are you using? Current gcc versions are only
almost-c99 compilers according to the documentation.

I am aware that some of the commercial compilers conform to C99.

Answered elsethread.
 
C

candide

obvious counter-example - it's a pointer, but not a variable.


And what is a variable ? The Standard doesn't define this term, and,
in fact, doesn't use it (except for rare examples or footnotes).
However, K&R2 heavily makes use of it, i found about 300 instances of
the strings "variable" and "variables". Alas they didn't worry about
giving a definition of the term "variable". The result is some
conflicting sentences, for instance (§5.2 about pointers and arrays) :

"the value of a variable or expression of type array is (...)"

versus

"But an array name is not a variable;"

So please, will you explain what do you mean by this term ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top