"Mastering C Pointers"....

M

Mark McIntyre

You are of course welcome to killfile anyone you want, however you
should be aware that Richard is telling you the truth and Roose is
not.

Actually, I have a nasty suspicion that Roose is talking to himself,
although I could be quite wrong. Its just that . I noticed with
interest an exchange not dissimilar to this just now:

Roose said: something incorrect
Richard replied: no, thats wrong
Alan said: oh, thats what I meant.

Note the use of the personal pronoun in the last response.
 
M

Mark McIntyre

Is it a British thing, or have you really never
been in the second year of secondary school or college?

I'm sure Richard has been a second year. At most secondary schools,
thats called "being a second year". At twelve, fancy names tend to be
avoided. Admittedly at my school it was called "being in Shell" but
thats another story.
At college its called "being a second year". First years are freshers,
third years are finalists unless they're doing mod lang, in which case
they're abroad, groping foreign 6th formers, or Divvers, in which case
they're drunk.

(IOW Sophomore is an americanism not in use over here...)
 
A

Alan Connor

register int SomeThing;

as opposed to

int SomeThingElse;

Given
int *PointerToSomething;

you can
PointerToSomething = &SomeThingElse;
but not
PointerToSomething = &SomeThing;
because SomeThing is a register qualified object, but SomeThingElse is not.

Thanks. Dont' get it.

Please fix your sig, Lew. It's over 4 lines and I'll have to killfile you
for 30 days if I see it again.
 
I

Irrwahn Grausewitz

Default User said:
Irrwhan is a knowledgable and helpful member of this group. Roose is a
dispenser of bad information and a troll. I suggest reviewing the two
persons' posting history on this newsgroup via a visit to groups.google.

<cough> I had a quick look into my 'Sent' folder and I'm not
sure if this is /really/ a good suggestion... <glibb> ;-)
 
I

Irrwahn Grausewitz

Alan Connor said:
Mark McIntyre's sig:
Mark: The limit for sigs on the Usenet is 4 lines and they need to be
immediately below a "-- " line.

Instead of complaining about the length of the sig you should've been
following the links to the clc faq and welcome message it provided.

Irrwahn
 
A

Alan Connor

You are of course welcome to killfile anyone you want, however you
should be aware that Richard is telling you the truth and Roose is
not. At least, he is not telling you the whole truth.

And all the people that ARE, are doing nothing but confuse me.
 
A

Alan Connor

But he posted to the news-group. There is not much privacy in
usenet discussions, ya know?!?

He was very helpful. More helpful than crap like this by far.

I'm interested in learning C, not playing a role in your stupid-assed
soap opera.
 
A

Alan Connor

Alan...

Wow! I'm impressed by your judgment. Richard has been one of the
most highly regarded regulars of comp.lang.c for some years now.
He's earned the professional (and personal) respect of many of
the best C programmers in the world, been recognized by Don Knuth
for spotting an error and providing a correction to "The Art of
Computer Programming", co-authored the book "C Unleashed" with
some of the most knowledgeable regulars here, and provided really
high-quality help to an awesome number of newbies (and a large
number of not-so-newbies, including myself) - all under the
scrutiny of expert peers who delight in picking nits - especially
when they're aware the poster /really/ knows his stuff.

I did say "impressed". I didn't say "favorably impressed". I
think I'd be honored if you called me deceitful and sophomoric
and a troll and killfiled me, too. I don't post as frequently as
Richard; but it /would/ save you at least some small amount of time.


Fine. If you launch a smear campaign against anyone here, I will be
happy to killfile your ass.
 
A

Alan Connor

Alan Connor wrote:

[Richard Heathfield]
Well, you just crossed the line with that bit of deceitful and sophomoric
trolling.

You are making a huge mistake. Richard is a frequent posters, a textbook
author and a well-respected member of this newsgroup.

Roose, on the other hand, is a troll who willing dispenses erroneous
information and replies with flames when challenged.

I suggest you reverse your decision. Killfile Roose, do not do the same
with Richard.




Brian Rodenborn


Why do you assume that I lack both eyes and common sense?


Richard and a few others have done almost nothing but attack Roos since
the thread began.

That's the only troll-like behavior I have seen here.

Everything Roos has told me has been verified by my research on the
Net and with local docs.

Roos has been helpful, much more so than Richard (although that one post
was indeed excellent)

Richard's buddies have mostly posted material that's way over my head and
just confuses me if I let it.

At least Roos knows that a novice doesn't know the lingo yet.


Yet you are telling me the opposite is true.


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

Irrwahn Grausewitz

Please fix your sig, Lew. It's over 4 lines and I'll have to killfile you
for 30 days if I see it again.

Oh, how threatening. Nobody here cares about trolls plonking
respectable and responsible posters in favour of other trolls.
Honestly.

Have an adequate day.
 
I

Irrwahn Grausewitz

Alan Connor said:
He was very helpful. More helpful than crap like this by far.

I'm interested in learning C,

The only thing you can learn from Roose is how to troll a news-group.
not playing a role in your stupid-assed
soap opera.

It's not a soap opera. It's reality. Wake up.
 
I

Irrwahn Grausewitz

Alan Connor said:
And all the people that ARE, are doing nothing but confuse me.

Oh, poor boy. Didn't the evil guys in usenet act as you wanted them
to? Too bad. Yes, life can be sooooo hard.

If you are not interested in correct information you can get from
the other posters here, take this Roose troll with you and move over
to alt.comp.lang.c. Virtually nobody else is posting there, so maybe
it's a good place for you two to stay.

Irrwahn
 
C

CBFalconer

Chris said:
....snip ...

For something really different, I would suggest trying these:

- Univac 11xx series: 18 and 36 bit integers, ones' complement
arithmetic. C compilers use 9-bit bytes.

- Data General Eclipse: conventional flat-memory RISC with one
twist: "byte pointers" (for char * and void *) are different
from all other, normal "word pointers". To convert a word
pointer to a byte pointer, the compiler must shift it left,
introducing a low-order zero bit.

- IBM AS/400. This is a "virtual architecture" with segmented,
protected memory. Pointers carry special qualification values
(a sort of access control list, as it were, or a "capability"
as it is usually called in other systems); pointers to code
are *much* larger than pointers to data.

One last architecture, for which I doubt there are any C compilers
(or even machines left? :) ), that can expand one's idea of how
to build computers, is the Burroughs A-series. There is a brief
(albeit a bit "gushy" :) ) overview at
<http://www.ajwm.net/amayer/papers/B5000.html>. (Many might quibble
with the claim that the Burroughs was the first machine to have
virtual memory, giving that honor instead to Manchester's Ferranti
Atlas.)

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.
 
K

Keith Thompson

Chris Torek said:
For something really different, I would suggest trying these:

- Univac 11xx series: 18 and 36 bit integers, ones' complement
arithmetic. C compilers use 9-bit bytes.

- Data General Eclipse: conventional flat-memory RISC with one
twist: "byte pointers" (for char * and void *) are different
from all other, normal "word pointers". To convert a word
pointer to a byte pointer, the compiler must shift it left,
introducing a low-order zero bit.

- IBM AS/400. This is a "virtual architecture" with segmented,
protected memory. Pointers carry special qualification values
(a sort of access control list, as it were, or a "capability"
as it is usually called in other systems); pointers to code
are *much* larger than pointers to data.

Another good example is the Cray vector machines (T90, SV1, et al).
As far as the C compiler is concerned, bytes are 8 bits, but all
integer types other than the char types are 64 bits. Native addresses
point to 64-bit words. A byte pointer is formed by storing a 3-bit
byte offset in the high-order bits of a 64-bit word pointer. Pointer
arithmetic works just fine, but I've seen non-portable code that tried
to do arithmetic on a pointer by casting it to an integer type,
performing integer arithmetic on it, and casting it back. It didn't
work.
 
K

Keith Thompson

Sheldon Simms said:
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.

I understand that you might not see why it matters one way or
the other, but there is a good reason to be precisely correct
right from the start: it prevents you from making lazy assumptions
that might not bite you now, but that probably will bite you
later.

Indeed, I just posted elsewhere on this thread a concrete example of
code that failed on a certain platform precisely because a pointer is
*not* just an integer on that platform. (The platform was a Cray T90.
A byte pointer on that platform is a 64-bit word pointer with a byte
offset stored in the high-order 3 bits. The code tried to convert the
pointer to an integer and perform arithmetic on the integer
representation.)

On many (most?) current systems, pointers are actually implemented as
integers. If you examine a pointer with a debugger, or cast it to an
appropriate integer type and print its value, you'll see something
that looks like a numeric hardware address (actually a virtual address
in most cases). If you let this observation lead you to assume that
pointers are *always* just integers, you're likely to make mistakes
like the one I described. If, on the other hand, you think of a
pointer (or an address) as an abstraction that may or may not be
implemented as an integer, you'll have a better understanding of
what's really going on.

A pointer, as the name implies, points to something. How it does so
is usually not something you need to worry about (though knowing the
target-specific details can be useful when you're tracking down a
problem). If it points to an array, you can perform arithmetic on it
to point to other parts of the same array. If two pointers point to
two distinct objects, you can ask whether the pointers are equal, but
there's no much else you can safely do with them. All these things
are derived from the abstraction of what a pointer is as defined by
the C language; you won't get this from an assumption that a pointer
is an integer.

What I'm arguing is not that you shouldn't know the underlying
details; that knowledge can certainly be useful, and can lead to a
clearer understanding of why the abstractions are defined the way they
are. What I'm arguing is that you should avoid *depending* on the
underlying details. The programmer who made the mistake I mentioned
above did so because he assumed that the underlying details of one
platform applied everywhere; I was able to track down the problem
because I knew the underlying details of the platform on which the
code failed, and how to avoid depending on them.
 
R

Roose

Roose would be much less maligned if he would surround his
explanations with "non-precise" cavils. An unnamed number of
decades ago I had a very good mathematics instructor, who often
preceded some explanation with "this is not exact nor complete,
but it gives the general flavor. Later we will return and develop
some real proofs".

I've made many such statements like that. Go back and read the posts. Note
the use of the word "pretend", and "I _know_ this is not true on many
machines, but the idea is to give him a general idea without getting bogged
down in details."
People would be well advised to learn the assembly language of a
simple processor. About the simplest is the PDP-8, while a more
complex machine is the 8080. I am omitting things like the 8008
because they are non-extendible, while the above two have complete
instruction sets which can be made to do many things with suitable
hardware. MIX belongs in there somewhere also.

I agree it would be "well advised." However, his real goal is to learn C.
You can easily get discouraged with the details of assembly language,
especially with the tools most people have available. That is why I suggest
it is nice to learn a simple model.
 
R

Roose

Let me just dispatch all of these flames toward Alan about me being a troll,
and his judgement and whatnot, with one comment...

It's completely transparent. If I were a troll, then you just let common
sense run its course. 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.

And, to which I would respond, as in the previous thread -- if I'm a troll,
then follow your own netiquette and killfile me. I don't care to be
responded to by people who don't think that I have something valuable to
say.

Note that you can killfile me, safe with the knowledge that there will be
plenty of others to nitpick. Really.

I'm not just addressing Grausewitz here, but everyone who is flaming Alan
for killfiling one of your Gods.

Roose

P.S. by jack-off, I don't mean technically wrong or even uninteresting, just
that it's obviously not helping the bigger picture. It just serves to show
off to everyone how much you know.
 
R

Roose

Richard Heathfield said:
[top-posting fixed]
Richard wrote:
I only post replies to you when it is necessary to correct your errors. If
you don't write articles, you won't make errors, so it won't be necessary
to correct them.

I think you've stumbled across a big time-saver. Well done.

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

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top