Reference and Pointer

J

Jakob Bieling

First off, please calm down. I am not trying to pick on you. I
explained my mental model of references to you, because you obviously
have trouble coping with yours (quote: "this automatic dereferencing
when you pass by reference I find most confusing"). If you do not want
to accept this way of thinking of references, it is fine with me. I do
not get paid for convincing you.
Jakob Bieling wrote:

(Sorry, I snipped the above line in my previous reply)
When you write: "No. This is not the address-of operator....
bla.bla.bla", then that's completely ridiciculous because I even
distinguished clearly between that myself in my previous explanation.

No you did not. See above. There you said "[..] pass arguments [..]
'by-reference' by using the '&'-operator" (which by itself is not right)
and the following example 'int& reference' just was not an address-of
operator.
IT IS IN C!

It is not, because it simply will not compile. Talking about
contexts.

int i = 0;
int& j = i; // _not_ C!
That exactly corresponds to what I wrote. So what's your point? Why
the hell are you just repeating my explanation, in your own words?

My point is just to completely lay out my mental model of references
to you, without leaving out details just because someone has said them
before.
I never wrote that!

Of course, you did not. But I did.
That exactly corresponds to what I wrote. So what's your point? Why
the hell are you just repeating my explanation, in your own words?
[*] Let's keep overloaded operators out of this .. simplifies my
wording :)

Let me be very clear here: There's *absolutely* no reason to discuss
overloaded operators here.

Please read what I wrote: "Let's keep overloaded operators out of
this" .. so I obviously did not have the intention to discuss them, but
rather included this little footnote for completeness to avoid replies
in that direction beforehand.
[..] "&reference" isn't the
variable itself - it's the *address* of that variable.
See above.
What I don't understand is why the h** you seem to disagree with me
and yet you're just repeating my whole explanation in your own words?

Maybe because your wording is misleading. It is confusing that you
write in one post, 'int& r' uses the address-of operator. When I tell
you that this is not true, you claim to have known that, telling me my
answer was ridiculous. If you knew that, then I apologize. On the other
hand, you should probably re-read your own postings before you send them
and make sure you are not misusing terminology and thus creating
confusion in the first place.
If I should cut everything down of what you wrote, then you completely
agree with me because it's just garbage you're writing about in this
post...

Not quite. Maybe you did not read my post carefully enough. The
mental model of references I presented does not suffer any confusing
auto-dereferencing, while yours does. If you do not like this model, I
honestly do not care. I do not gain anything, but even was I investing
my time to try to help you. If you do not want that, just say so and
save your time and mine.

hth
 
D

Default User

Martin Jørgensen wrote:

You're about to enter my kill-filter if you don't stop claiming I
wrote that references = pointers.

Frankly, that's not much of a threat. At any rate, I think we've
muddied up the water past any useful discussion at this point. You're
obviously getting agitated, and that will likely just result in an
increasingly acrimonious thread, so I'll leave it where it is.

I'll take your word for it that you understand the difference.




Brian
 
P

Phlip

Jakob said:
Martin Jørgensen wrote:

First off, please calm down. I am not trying to pick on you. I
explained my mental model of references to you, because you obviously have
trouble coping with yours (quote: "this automatic dereferencing when you
pass by reference I find most confusing"). If you do not want to accept
this way of thinking of references, it is fine with me. I do not get paid
for convincing you.

Ben: You can use Einsteinean physics to prove Newtonian physics...

Ken (a physicist wannabe): You certainly can NOT!!

Me: What Ben meant is that you can use Einsteinean physics to
demonstrate why Newton thought that Newtonian physics
would work.

One extremely convient way to explain references to folks familiar with
pointers is to say "It's like a pointer with the indirection already turned
on".

This simile is completely harmless, except when exposed to language lawyer
wannabes.

(And I'm probably not helping the situation;)
 
?

=?ISO-8859-1?Q?Martin_J=F8rgensen?=

Phlip said:
Martin Jørgensen wrote:




Have you stopped beating your wife, Martin?

;-)

I'm pretty tired of telling people how to use their brain...

Next thing is that I bet I should also tell them to remember to breathe
and eat...


Best regards / Med venlig hilsen
Martin Jørgensen
 
?

=?ISO-8859-1?Q?Martin_J=F8rgensen?=

Phlip said:
Jakob Bieling wrote: -snip-

Ben: You can use Einsteinean physics to prove Newtonian physics...

Ken (a physicist wannabe): You certainly can NOT!!

Me: What Ben meant is that you can use Einsteinean physics to
demonstrate why Newton thought that Newtonian physics
would work.

One extremely convient way to explain references to folks familiar with
pointers is to say "It's like a pointer with the indirection already turned
on".

This simile is completely harmless, except when exposed to language lawyer
wannabes.

(And I'm probably not helping the situation;)

Yes, you are helping the situation... It's basically really as simple as
that!

I can't believe people keep asking me crazy things about how to
understand this and how to understand that... I'm not their father,
raising a little child who was to learn everything from the beginning
and I'm pretty tired of spending my time telling people "how to
understand this and that"...


Best regards / Med venlig hilsen
Martin Jørgensen
 
?

=?ISO-8859-1?Q?Martin_J=F8rgensen?=

Jakob said:
First off, please calm down. I am not trying to pick on you. I

You're trying to waste as much of my time as possible.
explained my mental model of references to you, because you obviously
have trouble coping with yours (quote: "this automatic dereferencing

I don't care about your mental model! I never asked for your mental
model! I posted my reply so the OP could see and understand what I found
most difficult going from C to C++ and learning what's a reference and
how does it work.
when you pass by reference I find most confusing"). If you do not want
to accept this way of thinking of references, it is fine with me. I do
not get paid for convincing you.

I don't care about your mental model! I never asked for your mental
model! If I had asked for it I would write: "Please tell me this and
please tell me that" - my postings was originally for the OP who started
this thread and who was obviously confused about references and
pointers. So I contributed by telling him my own background and how it
was for me going from C to C++.
Jakob Bieling wrote:


(Sorry, I snipped the above line in my previous reply)

When you write: "No. This is not the address-of operator....
bla.bla.bla", then that's completely ridiciculous because I even
distinguished clearly between that myself in my previous explanation.


No you did not. See above. There you said "[..] pass arguments [..]
'by-reference' by using the '&'-operator" (which by itself is not right)
and the following example 'int& reference' just was not an address-of
operator.

I never wrote that the & in "int& reference" meant the
address-of-operator! Still you need "&" in the function header to use
pass-by-reference, you complete moron and that's what I wrote about!

Do I have to tell you how to breathe and when to breathe? Do I have to
tell you when to get to school or work? Do I have to tell you what to
think about in every goddamn possible way about every goddamn small tiny
thing, like when to raise your hand to do such really simple things as
eating or drinking, which normal people can understand themselves?
It is not, because it simply will not compile. Talking about
contexts.

int i = 0;
int& j = i; // _not_ C!

You fucking idiot! If you don't want to read what I'm writing then
please **** off. Did I ever write that in C you could write?:

int i = 0;
int& j = i; // _not_ C!

I DID NOT! You stupid idiot... I also gave some pretty detailed
explanations which are impossible not to understand for people who wants
to understand them - It is *VERY* clear that you don't even *WANT* to
understand what I wrote and there's simply no cure for that.
My point is just to completely lay out my mental model of references
to you, without leaving out details just because someone has said them
before.

Again: Please **** off with your mental model and all of your bullshit...
Of course, you did not. But I did.

You fucking idiot... Cut down all the bullshit and there's pretty much
nothing left in your posting.
'i' is just a name for a sequence of bytes in memory. 'j' is also a
name of a sequence of bytes in memory, but for a different one. Now,
'k' is a _different_name_ for the _same_sequence_ of bytes in
memory, that 'i' is a name for.

That exactly corresponds to what I wrote. So what's your point? Why
the hell are you just repeating my explanation, in your own words?
[*] Let's keep overloaded operators out of this .. simplifies my
wording :)


Let me be very clear here: There's *absolutely* no reason to discuss
overloaded operators here.


Please read what I wrote: "Let's keep overloaded operators out of
this" .. so I obviously did not have the intention to discuss them, but
rather included this little footnote for completeness to avoid replies
in that direction beforehand.

You stupid idiot... I take it that you didn't even read the previous
discussion because some other guy also wrote something about discussing
overloaded operators and I also stated exactly the same point as you've
just repeated several times here...

That fact just proves that you don't even want to read what the
discussion is all about (if you've read a few postings back, you would
have known about this).

It's now very clear to me that you don't even care about understanding
this whole discussion, unfortunately. And it looks pretty much to me
like you never intended that.
[..] "&reference" isn't the
variable itself - it's the *address* of that variable.
See above.

What I don't understand is why the h** you seem to disagree with me
and yet you're just repeating my whole explanation in your own words?


Maybe because your wording is misleading. It is confusing that you
write in one post, 'int& r' uses the address-of operator. When I tell

You need a brain to understand what I'm writing and understand the
difference between having the & in the function header and everywhere
else in the program.

So my advice to you is: Go ahead and buy yourself a brain - then you can
come back and discuss the address-of-operator if you want (at that time).
you that this is not true, you claim to have known that, telling me my
answer was ridiculous. If you knew that, then I apologize. On the other

You're a complete moron and your answer *IS* ridiculous...
hand, you should probably re-read your own postings before you send them
and make sure you are not misusing terminology and thus creating
confusion in the first place.

Well, what can I say: You don't want to read anything of what I write,
so here's a fair deal:

Then I don't want to read any of your bullshit - so welcome to my kill
filter...

I would say: That's a pretty fair deal...
Not quite. Maybe you did not read my post carefully enough. The
mental model of references I presented does not suffer any confusing
auto-dereferencing, while yours does. If you do not like this model, I

You complete idiot... Since you don't understand the mental model about
"auto-dereferencing" then ofcourse it's confusing for you because it
seems like you have a lot of trouble reading english explanations which
ofcourse also requires that you know some basics about programming.
honestly do not care. I do not gain anything, but even was I investing
my time to try to help you. If you do not want that, just say so and
save your time and mine.

I can see you only posted 2 replies here and both are complete full of
shit to a degree which I find so annoying that you're now in my kill-filter.

You didn't even care to read just a few previous postings to understand
what this discussion is about, before you posted all of your bullshit.

And with your attitude which is "trying to explain me" something, when
it in fact is you that needs to read some of the previous postings: ****
off...

EOD... You won't get another reply from me - you already wasted too much
of my time on ridiculous bullshit and I believe no ordinary thinking
person who read the previous (perhaps about 10, maybe 12-14) postings
doesn't know what the discussion is about.


Best regards / Med venlig hilsen
Martin Jørgensen
 
J

Jakob Bieling

Martin Jørgensen said:
You're trying to waste as much of my time as possible.


I don't care about your mental model! I never asked for your mental
model! I posted my reply so the OP could see and understand what I
found most difficult going from C to C++ and learning what's a
reference and how does it work.

Did he ask you to tell him what you found difficult? No. Was your
reply inappropriate? No.

Did you ask about my mental model? No. Was my reply inappropriate?
No.

You see, when you say that you have trouble with something, people
in the news group tell you their experiences. That is how news groups
work. If you cannot cope with this, do not come here.
I don't care about your mental model! I never asked for your mental
model! If I had asked for it I would write: "Please tell me this and
please tell me that" - my postings was originally for the OP who
started this thread and who was obviously confused about references
and pointers. So I contributed by telling him my own background and
how it
was for me going from C to C++.

See above.
Jakob Bieling wrote:
"Definition: The address of operator, &, returns the address of a
variable or object.
Now, in C++ you
can pass arguments in a function header "by-reference" by using
the "&"-operator. You can have a function header like this:
return_type some_function( int &reference ) {..... }
No. This is not the address-of operator. Just like the '&' below
is not the address-of operator either.
When you write: "No. This is not the address-of operator....
bla.bla.bla", then that's completely ridiciculous because I even
distinguished clearly between that myself in my previous
explanation.
No you did not. See above. There you said "[..] pass arguments
[..] 'by-reference' by using the '&'-operator" (which by itself is
not right) and the following example 'int& reference' just was not
an address-of operator.

I never wrote that the & in "int& reference" meant the
address-of-operator! Still you need "&" in the function header to use
pass-by-reference, you complete moron and that's what I wrote about!

You called it '&'-operator (see the quote above). It is not an
operator. That was the whole point.
Do I have to tell you how to breathe and when to breathe? Do I have to
tell you when to get to school or work? Do I have to tell you what to
think about in every goddamn possible way about every goddamn small
tiny thing, like when to raise your hand to do such really simple
things as eating or drinking, which normal people can understand
themselves?

?!
You fucking idiot! If you don't want to read what I'm writing then
please **** off. Did I ever write that in C you could write?:

int i = 0;
int& j = i; // _not_ C!

I DID NOT! You stupid idiot... I also gave some pretty detailed
explanations which are impossible not to understand for people who
wants to understand them - It is *VERY* clear that you don't even
*WANT* to
understand what I wrote and there's simply no cure for that.

If you are not willing to keep the discussion at an acceptable
niveau, I am not willing to discuss with you any further.

I know what you wrote and what I wrote. What I wrote was to
illustrate my point, which you have in rage obviously missed by far.
Again: Please **** off with your mental model and all of your
bullshit...
You fucking idiot... Cut down all the bullshit and there's pretty much
nothing left in your posting.

If all you have to add is cursing, please do not add anything at
all.
'i' is just a name for a sequence of bytes in memory. 'j' is also a
name of a sequence of bytes in memory, but for a different one.
Now, 'k' is a _different_name_ for the _same_sequence_ of bytes in
memory, that 'i' is a name for.

That exactly corresponds to what I wrote. So what's your point? Why
the hell are you just repeating my explanation, in your own words?

[*] Let's keep overloaded operators out of this .. simplifies my
wording :)


Let me be very clear here: There's *absolutely* no reason to discuss
overloaded operators here.


Please read what I wrote: "Let's keep overloaded operators out of
this" .. so I obviously did not have the intention to discuss them,
but rather included this little footnote for completeness to avoid
replies in that direction beforehand.

You stupid idiot... I take it that you didn't even read the previous
discussion because some other guy also wrote something about
discussing overloaded operators and I also stated exactly the same
point as you've just repeated several times here...
That fact just proves that you don't even want to read what the
discussion is all about (if you've read a few postings back, you would
have known about this).
It's now very clear to me that you don't even care about understanding
this whole discussion, unfortunately. And it looks pretty much to me
like you never intended that.

I read it all. Why does it bother you so much that I have just
excluded this topic once again, for those not having read it everything?
[..] "&reference" isn't the
variable itself - it's the *address* of that variable.

See above.

What I don't understand is why the h** you seem to disagree with me
and yet you're just repeating my whole explanation in your own
words?


Maybe because your wording is misleading. It is confusing that
you write in one post, 'int& r' uses the address-of operator. When I
tell

You need a brain to understand what I'm writing and understand the
difference between having the & in the function header and everywhere
else in the program.

So my advice to you is: Go ahead and buy yourself a brain - then you
can come back and discuss the address-of-operator if you want (at
that time).
you that this is not true, you claim to have known that, telling me
my answer was ridiculous. If you knew that, then I apologize. On the
other

You're a complete moron and your answer *IS* ridiculous...
hand, you should probably re-read your own postings before you send
them and make sure you are not misusing terminology and thus creating
confusion in the first place.

Well, what can I say: You don't want to read anything of what I write,
so here's a fair deal:

Then I don't want to read any of your bullshit - so welcome to my kill
filter...

I would say: That's a pretty fair deal...
Not quite. Maybe you did not read my post carefully enough. The
mental model of references I presented does not suffer any confusing
auto-dereferencing, while yours does. If you do not like this model,
I

You complete idiot... Since you don't understand the mental model
about "auto-dereferencing" then ofcourse it's confusing for you
because it seems like you have a lot of trouble reading english
explanations
which ofcourse also requires that you know some basics about
programming.

Yes, I will probably have a problem with that mental model. This is
why I do not use it. And you obviously have the same problem with it,
which is why I was trying to help.
I can see you only posted 2 replies here and both are complete full of
shit to a degree which I find so annoying that you're now in my
kill-filter.
You didn't even care to read just a few previous postings to
understand what this discussion is about, before you posted all of
your bullshit.
And with your attitude which is "trying to explain me" something, when
it in fact is you that needs to read some of the previous postings:
**** off...

EOD... You won't get another reply from me - you already wasted too
much of my time on ridiculous bullshit and I believe no ordinary
thinking
person who read the previous (perhaps about 10, maybe 12-14) postings
doesn't know what the discussion is about.

Do everyone a favor and try to be more calm in the next discussion
you take part in. And please consider accepting criticism about your use
of terminology. Maybe you should just look up what the '&'-operator is,
and what it is not.
 
D

Default User

Martin Jørgensen wrote:

And with your attitude which is "trying to explain me" something,
when it in fact is you that needs to read some of the previous
postings: **** off...

EOD... You won't get another reply from me - you already wasted too
much of my time on ridiculous bullshit and I believe no ordinary
thinking person who read the previous (perhaps about 10, maybe 12-14)
postings doesn't know what the discussion is about.

Your behavior is unacceptable.

*plonk*


Brian
 
?

=?ISO-8859-1?Q?Martin_J=F8rgensen?=

Default said:
Martin Jørgensen wrote:





Your behavior is unacceptable.

*plonk*


Brian

That would probably mean I don't have to waste more time on you. So
thank you very much for that.

I have more important things to spend my time on than this so I really
don't care what you think.


Best regards / Med venlig hilsen
Martin Jørgensen
 
P

persenaama

eference means you want another name for an object. References are
not addresses. They are a different concept:

I dare say that Martin doesn't have problem understanding what the
concepts mean and what the differences are, but rather wording the
idea, that you can *emulate* refefence-like behaviour with pointers in
C, in a way that would satisfy your tastes.

What gets to me, is that this wording problem is turned into "proof"
that someone does not understand what he is talking about. I
understood, or would be so inclined atleast, that I understood
immediately what he meant. But then again, I didn't approach this
thread with nitpicking on my mind foremost.

Ofcourse it is great to straighten out incorrect statements and so on,
but is it really a sign of intelligence to to always for the sake of
argument to think the worst, not the best, of the people you are
debating with begs to be asked.

Who here, honestly, thinks that points and references are too difficult
a concept to give much problem understanding for a 15 year old, not to
mention adult which I'm pretty positive everyone participating seem to
be?

Just a thought. Now ofcourse, it's obvious that I don't know the
difference, right? :)
 
P

persenaama

eference means you want another name for an object. References are
not addresses. They are a different concept:

I dare say that Martin doesn't have problem understanding what the
concepts mean and what the differences are, but rather wording the
idea, that you can *emulate* refefence-like behaviour with pointers in
C, in a way that would satisfy your tastes.

What gets to me, is that this wording problem is turned into "proof"
that someone does not understand what he is talking about. I
understood, or would be so inclined atleast, that I understood
immediately what he meant. But then again, I didn't approach this
thread with nitpicking on my mind foremost.

Ofcourse it is great to straighten out incorrect statements and so on,
but is it really a sign of intelligence to to always for the sake of
argument to think the worst, not the best, of the people you are
debating with begs to be asked.

Who here, honestly, thinks that points and references are too difficult
a concept to give much problem understanding for a 15 year old, not to
mention adult which I'm pretty positive everyone participating seem to
be?

Just a thought. Now ofcourse, it's obvious that I don't know the
difference, right? :)
 
?

=?ISO-8859-1?Q?Martin_J=F8rgensen?=

persenaama said:
I dare say that Martin doesn't have problem understanding what the
concepts mean and what the differences are, but rather wording the
idea, that you can *emulate* refefence-like behaviour with pointers in
C, in a way that would satisfy your tastes.

I know a couple of people felt the same way as you *very* early, because
this issue isn't difficult to understand at all and those long
explanations I gave just seems completely to be a waste of my time now.

I guess it was just 2 morons who *didn't* want to understand anything at
all, that made this thread go a bit crazy in the end.
What gets to me, is that this wording problem is turned into "proof"
that someone does not understand what he is talking about. I
understood, or would be so inclined atleast, that I understood
immediately what he meant. But then again, I didn't approach this
thread with nitpicking on my mind foremost.

Unfortunately I was pretty slow a figuring out that those morons never
intented to understand anything at all - if I knew it at some earlier
point, I shouldn't have written all those long explanations for
"programming idiots" (not even "programming newbies", because in that
case I really don't mind helping other people with understanding issues)...

Basically all that is left is that I wasted a couple of hours on some
stupid idiots - And I'm really tired of that, because those idiots tried
to give the impression that they helped me with something - and they
didn't help me at all with anything...

So, I never understood anything of all their rubbish/nonsense. I mean:
If I begin to teach a 10-year boy something about a computer and that
boy tells all his friends that in fact he's teaching me something about
computers - that would be the same as here in this discussion.

Good thing that the kill-filter has been invented...


Best regards / Med venlig hilsen
Martin Jørgensen
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top