473,889 Members | 1,386 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 22005
On Sat, 8 Nov 2003 23:33:10 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:
Richard Heathfield wrote:
Would you suggest that, say, 0 is an object?


At the risk of sinking my own battleship, not if its a literal.


Yeah, that was kind of my point. :-)


And I revert to my point - as the Standard says, a null pointer
constant must be converted to a pointer type before it can be compared
to a pointer. I still reckon that conversion requires storage.
--
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 #371
On Sat, 08 Nov 2003 19:59:14 +0000, Alan Connor wrote:
On Sat, 08 Nov 2003 18:15:12 GMT, Jim Showalter <ji***********@ hotmail.com> wrote:

Stupid is an understatement. The odds that two imbeciles would discover
one another on c.l.c are so great, that I think it much more likely that
"Alan Connor" is an invention of "Roose"!
I'm happy for you. Now shut the fuck up and get the hell out of my life
you stupid punk.


That's the whong answer.

Think about it: if Alan Connor is a real person, unconnected to Roose,
his reply would be one of incrediblity at such an assertion. Instead, he
reacts with genuine anger - like a thief caught in the act.

killfiled for 90 days. The other post goes unread.


Oh dear - I'll be counting the days.

Wonder what he meant by "The other post goes unread."?
jim
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/
_/ I'm all for computer dating, but I wouldn't want my sister to marry
_/ one.
_/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Nov 13 '05 #372
On Sun, 09 Nov 2003 01:07:07 +0000, Mark McIntyre wrote:
On Sat, 8 Nov 2003 23:33:10 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:
Richard Heathfield wrote:

Would you suggest that, say, 0 is an object?

At the risk of sinking my own battleship, not if its a literal.


Yeah, that was kind of my point. :-)


And I revert to my point - as the Standard says, a null pointer
constant must be converted to a pointer type before it can be compared
to a pointer. I still reckon that conversion requires storage.


I agree that the conversion must take place, but I don't agree
that it requires storage. A null pointer constant exists in source
code, but neither the null pointer constant nor the null pointer
need to exist at all in an executable program/object file/library,
etc. The conversion takes place in the compiler and may end up
being a conceptual conversion rather than an actual conversion.

For example, the code:

char * p;
...
if (p != 0) /* <-- here's a null pointer constant */
{
do_stuff();
}
do_other_stuff( );

might be translated:

tst r9 ;evaluate p and set flags
beq .L54
bsr do_stuff
..L54:
bsr do_other_stuff

No null pointer, object or value, at all.


Nov 13 '05 #373
Mark McIntyre wrote:
On Sat, 8 Nov 2003 23:33:10 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:
Richard Heathfield wrote:

Would you suggest that, say, 0 is an object?

At the risk of sinking my own battleship, not if its a literal.


Yeah, that was kind of my point. :-)


And I revert to my point - as the Standard says, a null pointer
constant must be converted to a pointer type before it can be compared
to a pointer. I still reckon that conversion requires storage.


Well, that's already been answered elsethread.

Your original point, with which I originally disagreed, was "(&a) in that
context is an expression. To be a pointer, it would have to be stored in
something. ."

Now, you already agree that &a is an expression that is not stored in
something. Great. You're right. Now let's see if we can work out, purely
from reference to the Standard, whether &a is also a pointer.

6.5.3.2 says:

"The unary & operator returns the address of its operand. If the operand has
type "type", the result has type "pointer to type".

QED.
--
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 #374
Mark McIntyre <ma**********@s pamcop.net> scribbled the following:
On Fri, 7 Nov 2003 07:56:20 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
goose wrote: (I wrote)
BUAATOO, IR.

??


Yeah, that's got me stumped as well.

but u are about the only one, I reckon


No wonder it got us stumped. I never thought you Mark would write in
h4x0r d00dsp33k.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"The day Microsoft makes something that doesn't suck is probably the day they
start making vacuum cleaners."
- Ernst Jan Plugge
Nov 13 '05 #375
On 9 Nov 2003 09:48:54 GMT, in comp.lang.c , Joona I Palaste
<pa*****@cc.hel sinki.fi> wrote:
Mark McIntyre <ma**********@s pamcop.net> scribbled the following:
On Fri, 7 Nov 2003 07:56:20 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
goose wrote:

(I wrote)
> BUAATOO, IR.

??

Yeah, that's got me stumped as well.

but u are about the only one, I reckon


No wonder it got us stumped. I never thought you Mark would write in
h4x0r d00dsp33k.


Fat fingers - should have been a Y....
--
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 #376
On Sun, 9 Nov 2003 06:45:53 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:

"The unary & operator returns the address of its operand. If the operand has
type "type", the result has type "pointer to type".


You got me. However I now use a cunning manoeuvre, and note that the
original expression had no side-effects and would have been removed by
the compiler during optimisation. So it still wasn't a pointer !! :-)
--
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 #377
Mark McIntyre <ma**********@s pamcop.net> scribbled the following:
On 9 Nov 2003 09:48:54 GMT, in comp.lang.c , Joona I Palaste
<pa*****@cc.hel sinki.fi> wrote:
Mark McIntyre <ma**********@s pamcop.net> scribbled the following:
On Fri, 7 Nov 2003 07:56:20 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
goose wrote:
(I wrote)
>> BUAATOO, IR.
>
> ??

Yeah, that's got me stumped as well.
but u are about the only one, I reckon


No wonder it got us stumped. I never thought you Mark would write in
h4x0r d00dsp33k.

Fat fingers - should have been a Y....


OK, I see.
Hmm, how about a VCR tape containing sample episodes of that quiz show
you and Richard are so fond of? It sounds so eccentrically British, I
want to see what it looks like.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"This is a personnel commuter."
- Train driver in Scientific American
Nov 13 '05 #378
On 9 Nov 2003 20:56:41 GMT, in comp.lang.c , Joona I Palaste
<pa*****@cc.hel sinki.fi> wrote:
Hmm, how about a VCR tape containing sample episodes of that quiz show
you and Richard are so fond of?
Err... Its a radio show.
It sounds so eccentrically British, I
want to see what it looks like.


it would certainly be eccentric to watch it. white noise video
perhaps? :-)
--
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 #379
Mark McIntyre <ma**********@s pamcop.net> scribbled the following:
On 9 Nov 2003 20:56:41 GMT, in comp.lang.c , Joona I Palaste
<pa*****@cc.hel sinki.fi> wrote:
Hmm, how about a VCR tape containing sample episodes of that quiz show
you and Richard are so fond of?
Err... Its a radio show.


A cassette then. It'll be cheaper and all.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Hasta la Vista, Abie!"
- Bart Simpson
Nov 13 '05 #380

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.