Trying to understand pointers for function paramaters

R

Richard Bos

Mabden said:
Why not just plonk Tisdale? Then you won't complain about minutia (sp?)

Because changing someone's post behind his back is _not_ a minutium. It
is a serious matter...
and I won't feel it necessary to demonstrate what a whinging
bastard I am...

....if you see what I mean.

Richard
 
M

Michael Mair

Richard said:
Because changing someone's post behind his back is _not_ a minutium. It
is a serious matter...


...if you see what I mean.

Oh no, must I now plonk you, Richard, for not saying it clearly... ;-)

Nice one, btw


--Michael
 
M

Mabden

Flash Gordon said:
On Tue, 05 Oct 2004 08:47:23 GMT



Tisdale doesn't get plonked by a lot of people because if no one pointed
out his errors people who did not know any better might believe him and
have problems as a result.

It's called "the internet" not "the gospel".
So people who are gratuitously insulting but either provide no advice or
correct advice get plonked, people who provide incorrect advice
generally don't get plonked even if they are gratuitously rude.


Well, it's nice to know that correct advice is plonkable. I'll try to
steer clear of providing any of that. So, in your world, do people say
"Goodbye" when you meet them and "Hello" when you depart?

Anyhow, I was just annoyed (again) at the bandwidth waste, and lack of
sleep (ok, too much beer) made me think it was important to comment.
Forget it and let's let this thread die.
 
K

Keith Thompson

Mabden said:
Well, it's nice to know that correct advice is plonkable. I'll try to
steer clear of providing any of that. So, in your world, do people say
"Goodbye" when you meet them and "Hello" when you depart?

The point is that we need to keep an eye on posters who post incorrect
advice, so newbies aren't misled. A lot of people would like to plonk
ERT, for example, but continue to read his articles so they can
correct his misstatements. Someone who is insufferably rude but
either offers correct advice or doesn't offer advice at all can be
safely ignored, since he's not likely to mislead anyone. It's how the
newsgroup defends itself.
Anyhow, I was just annoyed (again) at the bandwidth waste, and lack of
sleep (ok, too much beer) made me think it was important to comment.
Forget it and let's let this thread die.

Do us all a favor and don't post when you're drunk or hung over. This
isn't just a conversation that everybody is going to forget; everthing
you post here is archived permanently. The impression you've given so
far is not a good one.
 
M

Mabden

Keith Thompson said:
The point is that we need to keep an eye on posters who post incorrect
advice, so newbies aren't misled. A lot of people would like to plonk
ERT, for example, but continue to read his articles so they can
correct his misstatements. Someone who is insufferably rude but
either offers correct advice or doesn't offer advice at all can be
safely ignored, since he's not likely to mislead anyone. It's how the
newsgroup defends itself.


Do us all a favor and don't post when you're drunk or hung over. This
isn't just a conversation that everybody is going to forget; everthing
you post here is archived permanently. The impression you've given so
far is not a good one.

You've never Googled "Mabden" have you?! (I don't mean my posts)
 
K

Keith Thompson

Mabden said:
You've never Googled "Mabden" have you?! (I don't mean my posts)

No, I hadn't. Now I have. It appears to be a reference to the
fantasy works of Michael Moorcock. I'd ask you what the point is if I
cared.

I'll post to this thread again only if there's a technical C issue to
be discussed.
 
M

Mark McIntyre

You've never Googled "Mabden" have you?! (I don't mean my posts)

Why would anyone care about you fantasising about being a Moorcock
character? This is clc, not alt.weird.fantasy.
 
M

Mabden

Keith Thompson said:
No, I hadn't. Now I have. It appears to be a reference to the
fantasy works of Michael Moorcock. I'd ask you what the point is if I
cared.

Not just Moorcock, it's used elsewhere. It is generally a crude,
actively cruel, and mischievous race or spirit. The point (not that you
asked or cared) is that you are complaining about my "behaviour", but my
signature should be a hint that I'm not entirely housebroken.

But, I'm not hopeless. I just tend to slip back a step for every two
steps forward...
I'll post to this thread again only if there's a technical C issue to
be discussed.

Well, I tried to halt the thread once already...
 
M

Mark McIntyre

Not just Moorcock, it's used elsewhere. It is generally a crude,
actively cruel, and mischievous race or spirit. The point (not that you
asked or cared) is that you are complaining about my "behaviour", but my
signature should be a hint that I'm not entirely housebroken.

Actually, what it shows is that you're extremely childish if you think that
naming yourself after a fantasy creature that you like to imagine yourself
being is even remotely relevant in a technical group.


Just stick to C.
Well, I tried to halt the thread once already...

I'm not aware that you own usenet. If you want to stop a thread, then
you're being hitlerian and fascist.*

* that comment may go over your head tho.
 
T

Thomas Stegen

Richard said:
I'm not trying to solve a problem. I'm just trying to understand C.
In a function without pointer arguments, the argument(s) of that function
are set by value passing:

f(int i)
{
printf("%d", i);
}

int main()
{
int i;
f(i);
return 0;
}

I just don't understand why this is (a little bit) different with pointer
arguments.

It's not different at all really.

Grab:
1. A piece of paper.
2. A pen.
3. A house on a street.

The piece of paper is now your pointer variable, (int *p for example).
The pen is your assignment operator.
The house is your int object (int house for example).

But aside from that, if you want to tell anyone how to get to your house
do you pass them the whole house? I wouldn't think so (but you never
know). So what do you do? You write it down on a piece of paper. No, you
do not write down the house, you write down the address of the house.
Now your friends can come over after you give them that piece of paper.
Can they do anything to your house, like enter it, set it on fire just
by having your piece of paper? No they can't, they have to go to your
house first.

So essentially, the house has (at least) two aspects to it, the house
itself and its address. You have to make it clear which you want. With
variables in C it's the same thing. They have a value and an address.
You have to be clear on which you want. The & operator seems apt in
telling the compiler what it is you require. The piece of paper as well,
you have to be clear on whether you want to change the piece of paper
or the thing that is at the address it holds. In other words, how do you
tell your program to set fire to the piece of paper, how about whatever
is at the address written down? Well you simply say, set fire to this
piece of paper, or in the latter case you say set fire to what resides
at the address written down on this piece of paper.

See, the second statement a bit complex than the first. So should
require some more syntax as well. Also the syntax makes sense when
you consider that pointers are completely normal variables. When you
want something else than the value stored in a variable then you
need to tell the compiler that.


HTH.
 
M

Mabden

Mark McIntyre said:
Actually, what it shows is that you're extremely childish if you think that
naming yourself after a fantasy creature that you like to imagine yourself
being is even remotely relevant in a technical group.

Doh! I should have thought of that. Your approval is so important to
me...
I just meant I sometimes use crude language, and I find that can offend
the prissy little girly men who post here*, but I don't really mean to.
It is a habit, and I see that it is not appreciated here. I'm trying to
change, Oprah, but I tend to slip up.

* if you are not a prissy little girly man who post here, then this
comment does not apply to YOU.
Just stick to C.

Not my quote, that was Keith, so I'm not sure whether you are echoing
him or saying "a technical C issue" is different than "C". Not
important, just like the rest of your post.
I'm not aware that you own usenet. If you want to stop a thread, then
you're being hitlerian and fascist.*

* that comment may go over your head tho.

Not really, why would you think so? Hitler should be capitalized, tho.
By "stopping the thread" I meant I was done posting (as is Keith), but
then I get sucked back in...

Hopefully the rule will be enforced and the thread will die - which
rule? the one that a thread is dead once someone invokes the term
"Nazi" - which I think you just did!
 
M

Mark McIntyre

On Wed, 06 Oct 2004 10:04:36 GMT, in comp.lang.c , "Mabden"

(b*llocks, ad nauseam)

yeah, whatever.
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top