473,889 Members | 1,357 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
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote in message news:<bo******* ***@oravannahka .helsinki.fi>.. .
Ian Woods <ne******@wuggy nocaps.org> scribbled the following:
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote in
news:bo******** **@oravannahka. helsinki.fi:
Richard Heathfield <do******@addre ss.co.uk.invali d> scribbled the
following:
goose wrote:
> Mark McIntyre <ma**********@s pamcop.net> wrote in message
> news:<j9******* *************** **********@4ax. com>...
>> BUAATOO, IR.
>
> ?? Yeah, that's got me stumped as well.

But Understanding Ain't Always That Object-Oriented, I Remember.
What do I win? =)

Could someone give the FARG a call (if they're still around), we have a new
cognitive-science challenge for them!


Sorry, I don't understand. What's the FARG?


Frequently Answering/Responding Groups ???

goose,
Nov 13 '05 #381
On 10 Nov 2003 08:17:12 GMT, in comp.lang.c , Joona I Palaste
<pa*****@cc.hel sinki.fi> wrote:
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.


the wonders of modern technology

http://www.bbc.co.uk/comedy/clue/clips/

--
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>
Nov 13 '05 #382
Irrwahn Grausewitz wrote:
(snip)
(about Alan Connor)

I had some spare time and did a quick google groups search. If you're
only interested in the highlights, do a search for threads that have his
name in the _subject-line_. For the full load perform a search for
articles he posted. It's real fun.


Wow ! I'm impressed ! Everyone should have a look !
Bruno

Nov 13 '05 #383
Chris Torek wrote:

(As an aside: on modern operating systems, "memory" is usually an
illusion anyway. The OS will *simulate* a nice linear sequence of
bytes, but it does so with "pages" that are "paged in" and "paged
out" to/from some form of "backing store" -- typically on disk --
and shuffled and reshuffled without any individual program, whether
coded in C or any other language, being able to see what is happening.
The hardware must provide a certain amount of assistance to let
the OS know what a program is trying to do, and the OS then determines
whether the code is doing something "normal" and "allowed", and if
so, arranges to allow it. The OS can then also determine whether
the program is running amok, and if so, stop it. While large chunks
of OSes can be written in nothing other than strictly conforming
C code, parts *must* be written using stuff outside the C standard,
and often must be hand-coded in assembly. These include the parts
that talk with hardware to find out what the various user programs
are attempting.)


Are you talking about accessing memory through segmented memory spaces
by segment registers or access through the virtual memory page table? or
both?

Thanks..qb

P.S. Fascinating post by the way.
Nov 13 '05 #384
On 5 Nov 2003 01:19:30 -0700, Chris Torek <no****@elf.eng .bsdi.com>
wrote:
Chris Torek <no****@elf.eng .bsdi.com> writes:
For something really different, I would suggest trying[list of

"different" machines]

In article <3F************ ***@yahoo.com> CBFalconer <cb********@yah oo.com>
writes:
Shouldn't the HP3000 running MPE fit in there somewhere? I
believe it just became unsupported. Many Burroughsisms. It DID
have a C compiler 25 years ago.


Well, 25 years ago was 1987, which predates ANSI C, but mainly I
did not list it because I never used it nor even read much about
it. (I have not used the AS/400 either, but I have read a bit from
those who have.) I think certain Tandem machines might also fit
in the "oddball" category.

The original Tandem architecture, now known (more or less) as TNS1,
embedded as a core in the successor TNS2 which is still supported in
emulation though fading somewhat, had the (8-bit-)byte pointer versus
(16-bit-)word pointer issue. TNS1 had another (even odder?) feature,
that code is not only in a separate segment (like PDP-11 I&D-space
models) but (and still in TNS2) function pointers use a completely
different representation, so that even if a compiler is persuaded to
issue instructions to access code space using a pointer, doing so
using a function pointer doesn't get you to that function -- at best,
if you twiddle some bits, it gets you to an entry or exit vector slot
*for* the function. Of course in standard C you can't do anything with
a function pointer but remember it and call through it, which works.

And as long as someone brought up HP3k, another unusual feature of TNS
is that it does most (but not all!) computational operations in a
(register) stack-oriented fashion -- LOAD x; LOAD y; SUB; STOR z --
(very) vaguely similar to that machine. But since C never requires any
variables, even those marked 'register', to actually be in registers,
limitation on directly accessing registers is not a real problem.

- David.Thompson1 at worldnet.att.ne t
Nov 13 '05 #385
On 3 Nov 2003 14:54:00 -0800, li************* **@yahoo.com (August
Derleth) wrote:
<snip>
Then I guess you never learned the beauty that is VAX, I suppose?
More's the pity: Understanding some of the intricacies of the DEC
minicomputers can help you grasp why some of C's crucial early design
decisions were made the way they were. For example, a flat memory
model and the whole notion of pre[increment|decre ment] being usefully
different from post[increment|decre ment] both came directly from the
PDPs.
Part of that seems to be an urban legend. If you believe dmr, his
2HOPL paper available at http://cm.bell-labs.com/cm/cs/who/dmr/ says
{pre,post}{inc, dec} were in B on PDP-7, which did not have them in
hardware. And PDP-11 had only postinc and predec for (primitive)
pointers, which became the idiomatic usage.

The flat memory model came from, and indeed was even stronger in,
BCPL, which AFAICT existed on mainframes before it saw any DEC, though
it seems to have become most widespread on PDP-10.
Truly, C was designed to be somewhere between PDP-11 assembly and
PL/1, but closer to assembly in some key ways.

Not PDP-11 specifically, but between the machine/assembly level of the
"average" minicomputer and something like PL/I or algol, yes; as were
several other System Implementation Languages of the day.

For what it's worth, I firmly believe that it would do most of the current crop
of "low level programmers" to learn IBM 370 Assembly language. This to find out
how to do things when you don't have a stack, aren't working in ASCII, and must
calculate with /very/ long decimal numbers. ;-)


And I think learning PDP-8 assembly is what seperates the men from the
boys, esepcially if you can only use the 8 `actual' opcodes. ;)


Well, I learned -8 assembly (really, machine) as a boy (of 15), and it
didn't aid my maturation or status. I'm not sure what you mean by that
"only" -- you have to write out IOT 031 (IIRC) instead of KSF? Is that
really a big deal? But the -10 was definitely cooler; what other
machine carefully documents which no-ops (including unsuffixed JUMP
and SKIP) are faster than others? Or where a single instruction can
take forever, due to indirection loop?

- David.Thompson1 at worldnet.att.ne t
Nov 13 '05 #386
>Chris Torek wrote:
(As an aside: on modern operating systems, "memory" is usually an
illusion anyway. The OS will *simulate* a nice linear sequence of
bytes ...

In article <33Csb.378617$6 C4.347933@pd7tw 1no>
John Kordyback <jk********@hot mail.com> writes:Are you talking about accessing memory through segmented memory spaces
by segment registers or access through the virtual memory page table? or
both?


Either, both, or perhaps even neither, depending on the hardware.

One of the recently-popular hardware methods of implementing virtual
memory uses an "inverted page table" instead of the usual
tree-structured page tables. Whether this counts as a "page table"
depends on who does the counting, as it is a "page table", but
"inverted" so not really. :-) In practice, the method is: on a
TLB miss, attach the current "unique address-space identifier" to
the virtual address, feed that through some kind of hash function,
and look in a global table entry based on the result. Expressed
in C it looks like this:

if ((found = tlb_search(id, vaddr, &paddr, &permissions )) == 0) {
index = hash(id, addr);
/*
* Hardware may do N of these, either sequential
* or rehashed.
*/
if (global_table[index].id == id &&
global_table[index].vaddr == vaddr) {
paddr = global_table[index].paddr;
permissions = global_table[index].permissions;
found = 1;
}
}
if (!found || wrong_permissio ns())
take_hardware_e xception();

A conventional "forward" page table lookup usually divides up the
virtual address in some way and does 3 or 4 table lookups on each
piece, with each table's output being an input to the next. The
very top level table is often (but not always) called a "segment"
table.

Some hardware imposes neither "regular" nor "inverted" page tables.
MIPS and SPARC CPUs, for instance, implement only the TLB lookup
part of the process. If the TLB search misses, everything else is
up to software.

Fortunately, dealing with all this is normally an OS's job --
ordinary C code just sees ordinary, "locally flat" memory. Even
if each data object is stored in a separate segment, the contiguous
bytes that make up one object have nice linear addressing, as
handled by simple pointer arithmetic. But one could imagine a
system in which the C compiler provides the "OS-like functions" on
a modern paged CPU. Here pointer arithmetic like "p+3" might have
to consult any page tables to see if the new address is somewhere
over the rainbow.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (4039.22'N, 11150.29'W) +1 801 277 2603
email: forget about it http://67.40.109.61/torek/index.html (for the moment)
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 13 '05 #387
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote in message news:<bo******* ***@oravannahka .helsinki.fi>.. .
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.


New series just started. You can listen to each episode for a
week after transmission on Monday evenings.

http://www.bbc.co.uk/radio4/comedy/clue.shtml
Nov 13 '05 #388
On 17 Nov 2003 23:28:38 -0800, in comp.lang.c , jj*@bcs.org.uk (J. J.
Farrell) wrote:

(discussing of all things, I'm Sorry, I Haven't a Clue.)
New series just started. You can listen to each episode for a
week after transmission on Monday evenings.

http://www.bbc.co.uk/radio4/comedy/clue.shtml


I especially liked the idea of singing "The Red Flag" to the tune of
"Bring me Sunshine". For those of you not familiar with the latter
song, it was the rather jolly theme tune to The Morcambe and Wise
Show, another mildly insane british comedy series.

Excuse me while I skip off into the wings with Angela Rippon.
--
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>
Nov 13 '05 #389

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.