473,889 Members | 1,352 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 21994
Alan Connor wrote:

<snip>
We'll see. But trolling gets anyone killfiled for a while. I don't care
if it's being done by Dennis Ritchie.


Ah, the irony! The exquisite irony!

--
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 #131
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. Also, consider:

int main(void)
{
int i;
int *p = &i; /* &i is not a variable, but it is a pointer */
return 0;
}

Of course, Alan won't learn this, at least not yet. His problem, not mine.

--
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 #132
Just answer the questions.


You appear to be a very bright light, a couple of pairs of manacles, a
bloodstained wooden chair, a rope, a soundproof room, a rubber hose, a
piece of lead piping, an electric shock device, and a whole bucketful of
broken teeth short of a torture chamber. Until you get those deficiencies
sorted out, I'll answer the questions /I/ choose to answer.


Are you suggesting that I've tortured you? I didn't realize that forcing
all your inadequacies and defects of personality into the light -- oh god
the light -- would be so painful. So I understand the reluctance to answer
simple, straightforward questions.
They shouldn't be that hard for you. That is,
if you're going to keep nitpicking -- otherwise feel free to ignore
_everything_ I post.


I do feel free to ignore everything you post, but I also feel free to read
everything you post. And, of course, I feel free to correct such errors of
yours as I may notice from time to time. Freedom is a wonderful thing, is
it not?


Let me suggest that if you answer them in a _polite_ manner, then I will
feel free to let them stand, unanswered, for the rest of the group to learn
from. Otherwise, I will respond in kind when the points are irrelevant to
the larger question, and/or acknowledge their correctness when they are
relevant (as I have already done in more than one case).
Nov 13 '05 #133
Roose wrote:
For example, Roose said "a pointer is an integer". This is not
true. A pointer *might* be an integer, and it might be something
else, like two distinct integers, or something else entirely.
How about, "At least some bits of the binary representation of a pointer
can
be interpreted as an integer."


That's trivially true, because /all/ the bits of the object representation
(what you call the binary representation) of /any/ value can be interpreted
as an integer:

void PrintObjectRepr esentation(FILE *fp, void *p, size_t len)
{
unsigned char *objrep = p;
while(len--)
{
printf(fp, " %X", *objrep++);
}
putc('\n', fp);
}
I didn't say anything about casting
pointers to integers.
Perhaps you should have done. The Standard says:

"Conversion s that involve pointers (other than as permitted by the
constraints of $3.3.16.1) shall be specified by means of an explicit cast;
they have implementation-defined aspects: A pointer may be converted to an
integral type. The size of integer required and the result are
implementation-defined. If the space provided is not long enough, the
behavior is undefined. An arbitrary integer may be converted to a pointer.
The result is implementation-defined./37/ A pointer to an object or
incomplete type may be converted to a pointer to a different object type or
a different incomplete type. The resulting pointer might not be valid if
it is improperly aligned for the type pointed to."
Of course, that sentence is much less clear at the expense of a detail.
It doesn't get across the basic point as well.


If the basic point is /wrong/, it's not helpful.

<snip>

--
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 #134
Roose wrote:

<snip>
It's because you think I actually something
valuable to say, that competes with your jack-off C standard knowledge,
that you must repeatedly, vehemently insist that I'm a troll.


Not so. If you have something valuable to say, please say it. We are all
waiting (with varying degrees of patience).

But we haven't seen it yet, as far as I can tell.

<snip>

--
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 #135
Roose wrote:
> Just answer the questions.


You appear to be a very bright light, a couple of pairs of manacles, a
bloodstained wooden chair, a rope, a soundproof room, a rubber hose, a
piece of lead piping, an electric shock device, and a whole bucketful of
broken teeth short of a torture chamber. Until you get those deficiencies
sorted out, I'll answer the questions /I/ choose to answer.


Are you suggesting that I've tortured you?


No. Learn To Read (tm).

--
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 #136

"Richard Heathfield" <do******@addre ss.co.uk.invali d> wrote in message
news:bo******** **@titan.btinte rnet.com...
Roose wrote:
> Just answer the questions.

You appear to be a very bright light, a couple of pairs of manacles, a
bloodstained wooden chair, a rope, a soundproof room, a rubber hose, a
piece of lead piping, an electric shock device, and a whole bucketful of broken teeth short of a torture chamber. Until you get those deficiencies sorted out, I'll answer the questions /I/ choose to answer.
Are you suggesting that I've tortured you?


No. Learn To Read (tm).


Just engaging in some light wordplay, children's games if you will. You're
familiar with those. Remember that other thread?


--
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 #137
On Tue, 04 Nov 2003 06:28:29 +0000, Richard Heathfield 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.


No problem.
A pointer need not be variable. For example, there exists such a thing as a
null pointer constant. Also, consider:

int main(void)
{
int i;
int *p = &i; /* &i is not a variable, but it is a pointer */
return 0;
}


All true. I'll try to update to be precisely correct.

-Sheldon

Nov 13 '05 #138
In article <%Q************ *******@newssvr 21.news.prodigy .com>,
no****@nospam.n ospam says...
Chris, I enjoyed reading your post and there is definitely interesting
information here. But I would contend that if someone doesn't yet have a
good understanding of pointers, he won't have the foggiest idea what you're
talking about. : )


Roose, if you want to be a moderator of a newsgroup, why do you not go
start one and see how many sheep wish to join your flock?

--
Randy Howard _o
2reply remove FOOBAR \<,
_______________ _______()/ ()_____________ _______________ _______________ ___
SCO Spam-magnet: po********@sco. com
Nov 13 '05 #139
On Tue, 04 Nov 2003 06:37:49 GMT, Roose <no****@nospam. nospam> wrote:


> Just answer the questions.


You appear to be a very bright light, a couple of pairs of manacles, a
bloodstained wooden chair, a rope, a soundproof room, a rubber hose, a
piece of lead piping, an electric shock device, and a whole bucketful of
broken teeth short of a torture chamber. Until you get those deficiencies
sorted out, I'll answer the questions /I/ choose to answer.


Are you suggesting that I've tortured you? I didn't realize that forcing
all your inadequacies and defects of personality into the light -- oh god
the light -- would be so painful. So I understand the reluctance to answer
simple, straightforward questions.
> They shouldn't be that hard for you. That is,
> if you're going to keep nitpicking -- otherwise feel free to ignore
> _everything_ I post.


I do feel free to ignore everything you post, but I also feel free to read
everything you post. And, of course, I feel free to correct such errors of
yours as I may notice from time to time. Freedom is a wonderful thing, is
it not?


Let me suggest that if you answer them in a _polite_ manner, then I will
feel free to let them stand, unanswered, for the rest of the group to learn
from. Otherwise, I will respond in kind when the points are irrelevant to
the larger question, and/or acknowledge their correctness when they are
relevant (as I have already done in more than one case).


This is very sophisticated duelling, and somewhat entertaing, but I'd much
rather you were each expounding upon the fundamentals of C in your individual
and unique styles.

But I am curious, Roose, as to why you continue feeding the troll? Trolls
don't care about reason or truth or the subject at hand. They pretend to be
in order to create and win a game of dominance in which they can't increment
the value of SELF but must decrement the value of OTHER.
--
Alan C this post ends with w
q
Nov 13 '05 #140

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.