473,842 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Mastering C Pointers"....

Hey guys, I'm new here, just a simple question.

I'm learning to Program in C, and I was recommended a book called,
"Mastering C Pointers", just asking if any of you have read it,
and if it's worth the $25USD.

I'm just looking for a book on Pointers, because from what I've
read it's one of the toughest topics to understand.

thanks in advanced.

sincerely ... Andy
Nov 13 '05
388 21968
Keith Thompson wrote:

<snip>
Something I forgot to mention before: One if the first things that
breaks down if you carry the "pointers are like symlinks" analogy too
far is that pointers, unlike symlinks, are typed. An object of type
"int*" can only point to an int.


Betraying my ignorance of all things Unixy here, but is not a symlink only
capable of pointing to an inode? Could it not, therefore, be said to be
"typed" at some level?

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #201
In article <bo**********@t itan.btinternet .com>,
Richard Heathfield <bi****@eton.po wernet.co.uk> wrote:
Keith Thompson wrote:

<snip>
Something I forgot to mention before: One if the first things that
breaks down if you carry the "pointers are like symlinks" analogy too
far is that pointers, unlike symlinks, are typed. An object of type
"int*" can only point to an int.


Betraying my ignorance of all things Unixy here, but is not a symlink only
capable of pointing to an inode? Could it not, therefore, be said to be
"typed" at some level?


In some ways, but that's not terribly helpful.

ObC: It's a lot like saying that a void pointer is only capable of
pointing to a bunch of bytes and not, say, the stuffed penguin on my desk.
dave

--
Dave Vandervies dj******@csclub .uwaterloo.ca
To anyone who has seen LISP-ish rightward binary trees, this is perfectly
clear. Although one might wonder what such a person is doing writing C.
--David Thompson in comp.lang.c
Nov 13 '05 #202
On Tue, 4 Nov 2003 19:48:46 +0000, Mark Gordon <sp******@fla sh-gordon.me.uk> wrote:


On Tue, 04 Nov 2003 18:08:24 GMT
"Roose" <no****@nospam. nospam> wrote:
Yes, I'd be quite curious to think what might happen... : ) Are they
going to come over my house and bother me about standard C?


No, but if they recognise you in an interview for a job your posts here
would be held against you. Equally some of mine where I have made
mistakes could be held against me, but I would like to think that I've
not posted anything as bad as some of your advice.


Yes. Your posts could well be held against you.

So those people here who have engaged in concerted character assassination
may well find prospective employers looking at their posts and asking
themselves:

Do I want a viscious, dishonest, and hateful person like that working here?

And Roose could certainly make sure that anyone he is applying to saw
a sampling of those posts, which could well cause the interviewer to ignore
any legitimate criticisms on the part of the posters.....

Like the boy who cried "wolf" too often.
--
Alan C this post ends with w
q
Nov 13 '05 #203
On Tue, 04 Nov 2003 21:30:30 GMT, Keith Thompson <ks*@cts.com> wrote:


Alan Connor <zz****@xxx.yyy > writes:
[...]
The fact that a bunch of obvious jerks don't like you is an extremely
good recommendation in my book, Roose.
Alan, I believe you're making a mistake. As a relative newcomer to
this newsgroup, I can certainly understand you not being interested in
some of the recent discussions about topicality and netiquette. Such
things are an unfortunate side effect of having such a free-wheeling
community with no central control.


Thank goodness there is no central control. Freedom from authoritarian
bigots is one the best things about Usenet.

Roose is, I believe, being deliberately disruptive.
I think that you are lying there. A person stupid enough to believe that
would not be capable of operating a computer.

Richard and others (including myself to some extent) have been criticizing him for
his behavior and correcting his misstatements.
If only you stopped there, which you obviously don't. Another lie.

Richard in particular has been an extremely valuable and valued contributor to this
newsgroup for many years, because of his technical expertise, his
willingness to share it with others, and his willingness to learn from
others. If you choose to pay attention to Roose and ignore Richard,
the loss will be yours.

That's my advice. Take it or leave it.


I think for myself, Keith.

And I think you are a liar, and am sick of this continued smear campaign
against Roose.

--
Alan C this post ends with w
q
Nov 13 '05 #204
Richard Heathfield <do******@addre ss.co.uk.invali d> writes:
Keith Thompson wrote:
<snip>
Something I forgot to mention before: One if the first things that
breaks down if you carry the "pointers are like symlinks" analogy too
far is that pointers, unlike symlinks, are typed. An object of type
"int*" can only point to an int.


Betraying my ignorance of all things Unixy here, but is not a symlink only
capable of pointing to an inode? Could it not, therefore, be said to be
"typed" at some level?


A symlink doesn't point directly to an inode; it refers to a file
name. That's what distinguishes a symlink (*symbolic* link) from a
hard link. On the file system implementation level, a symlink is just
a plain text file containing the name of its target, with a type
attribute that says it's a symlink. If you remove the target file,
the symlink is still there, pointing to nothing; recreate the target
file and the symlink is valid again.

The loose analogy with pointers is: files are objects, file names are
their addresses, and symlinks are pointer objects. The analogy
rapidly breaks down if you go much beyond this.

A hard link points to an inode; in fact, all files are implemented as
hard links. Symlinks can cross fileystem boundaries; hard links
can't.

The implementation details and terminology are probably incorrect in
some ways, but I believe they convey the general idea.

--
Keith Thompson (The_Other_Keit h) ks*@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 13 '05 #205
On Tue, 04 Nov 2003 09:53:30 GMT,
Richard Bos <rl*@hoekstra-uitgeverij.nl> wrote:

For an example where assuming that "integer" is equivalent to "pointer"
leads to a bug, assume that a pointer is six bytes and the best
available integer four.

Not exactly your scenario but I've seen 15 year old code break because
malloc was cast and stdlib.h wasn't included. New 64 bit machine with
32 bit ints and 64 bit pointers ....

Interestingly, this was the second machine with this pointer/int size
mismatch that the code was ported to but the first one to see (repeatable)
crashes.

Tim.

--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

http://tjw.hn.org/ http://www.locofungus.btinternet.co.uk/
Nov 13 '05 #206

What I would like to see is one un-corrected, in-context statement by Roose
that if accepted by a novice as the whole picture for a *while* would result
in them being unable to ever program effectively in C.

Because *that* is what so many people are accusing him of, and I think that
this is an outrageous and malicious exaggeration, at BEST.

--
Alan C this post ends with w
q
Nov 13 '05 #207
On Tue, 04 Nov 2003 19:29:03 GMT, in comp.lang.c , Alan Connor
<zz****@xxx.yyy > wrote:
On Tue, 04 Nov 2003 07:49:07 GMT, Roose <no****@nospam. nospam> wrote:


In C, the "address" is
basically an integer, indicating where in a huge array of memory the
variable is.
That's it.


You'd be VERY well advised to forget this idea, if you intend to
actually learn C for commercial purposes. In many systems, including
x86, a pointer is most definitely NOT an integer. It may be two
integers for instance. Or Something Else Entirely.
The fact that a bunch of obvious jerks don't like you is an extremely
good recommendation in my book, Roose.


*sigh*.
People have no particular opinion of roose, what people object to are
the errors, falsehoods and omissions in the posts coming from roose.

Don't mistake exasperation with someone's intransigence for something
else.

And don't assume that the mickey-mouse answer is right just because
you find it easier to grok. Truth is often harder to learn.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #208
On Tue, 04 Nov 2003 22:29:03 GMT, in comp.lang.c , Alan Connor
<zz****@xxx.yyy > wrote:
On Tue, 04 Nov 2003 21:30:30 GMT, Keith Thompson <ks*@cts.com> wrote:

Roose is, I believe, being deliberately disruptive.
I think that you are lying there. A person stupid enough to believe that
would not be capable of operating a computer.

others (including myself to some extent) have been criticizing him for
his behavior and correcting his misstatements.


If only you stopped there, which you obviously don't. Another lie.


Okay, enough. You're either a total idiot, or you're a troll.

Only one or the other would call Keith Thompson AND Richard Heathfield
liars within a single post. For our amusement as much as your own
enlightenment, you might want to google for the history of their
posts, and do a quick author search on Amazon, and then reflect on
just how stupid you now look.
I think for myself, Keith.

And I think you are a liar, and am sick of this continued smear campaign
against Roose.


You /are/ roose. I claim my five pounds.

*plonk*
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #209
On Tue, 4 Nov 2003 06:28:29 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Sheldon Simms wrote:
Ok, let me try to tell you something about pointers that is (hopefully)
precisely correct, but won't confuse you.

A pointer is a kind of variable that can "point to" some object.


This isn't precisely correct. Sorry to dash your hopes.

A pointer need not be variable. For example, there exists such a thing as a
null pointer constant.


And of course a null pointer is a pointer that doesn't point to
anythin....

And are functions objects?

So can we settle on "a pointer is an object that can probably point to
another object, or possibly to a function, which is possibly not an
object, ouch my head hurts"?
:-)

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #210

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.