about Pointer

H

herrcho

#include <stdio.h>

int main()
{
printf("%s",*("abc" + 1));
return 0;
}

i expected this would show 'bc'

but, Compile error message : format argument is not a pointer (arg 2)

as far as i know, "abc" + 1 is pointer , right ?

Could anyone explain about this ?

TIA ^^
 
M

Morris Dovey

herrcho said:
#include <stdio.h>

int main() { printf("%s",*("abc" + 1)); return 0; }

i expected this would show 'bc' but, Compile error message :
format argument is not a pointer (arg 2)

as far as i know, "abc" + 1 is pointer , right ?

Herrcho...

Right; but *("abc" + 1) is not a pointer.
 
M

Mike Wahler

herrcho said:
#include <stdio.h>

int main()
{
printf("%s",*("abc" + 1));
return 0;
}

i expected this would show 'bc'

but, Compile error message : format argument is not a pointer (arg 2)

as far as i know, "abc" + 1 is pointer , right ?

Yes. But *("abc" + 1) , which is the expression you
supplied for the argument, is not. Its type is 'char'.

printf("%s", "abc" + 1);
Could anyone explain about this ?

Um, you didn't look at your code carefully enough? :)

-Mike
 
D

Darrell Grainger

#include <stdio.h>

int main()
{
printf("%s",*("abc" + 1));
return 0;
}

i expected this would show 'bc'
but, Compile error message : format argument is not a pointer (arg 2)
as far as i know, "abc" + 1 is pointer , right ?
Could anyone explain about this ?

("abc"+1) is a pointer. *("abc"+1) is a char. Try:

printf("%s", ("abc"+1));
 
C

clord

#include <stdio.h>

int main()
{
printf("%s",*("abc" + 1));
return 0;
}

i expected this would show 'bc'

but, Compile error message : format argument is not a pointer (arg 2)

as far as i know, "abc" + 1 is pointer , right ?


Could anyone explain about this ?

Yes, but I won't. Other, more benevolent persons, have already taken the
time to point out your short comings.

If hindsight is 20-20, then you must have perfect vision, becuase your an
ass.

clord
 
M

Mike Wahler

Yes, but I won't. Other, more benevolent persons, have already taken the
time to point out your short comings.

A few rational people have answered the question.
Yours is the only reply I see that contains an insulting
tone (and contained no useful info btw).
If hindsight is 20-20, then you must have perfect vision, becuase your an
ass.

An obvious novice with C asked a valid topical question,
responses to which would be educational to any
other 'newbies' reading.

How does this make Herrcho an 'ass'?

You, however, look like an inconsiderate jerk who cannot
even spell simple English words.

*PLONK*

-Mike
 
C

clord

Woo hoo! Top posting is fun!


A few rational people have answered the question.

Rational? I think you are making assumptions, or what we might refer to
as "hasty generalizations".

Yours is the only reply I see that contains an insulting
tone (and contained no useful info btw).

Again, you are wrong. My tone is one of mirth, not insult. To be
absolutely clear, I was joking! I was trying to highlight how much of a
jerk everybody else in this newgroup is.



Now that was funny!

An obvious novice with C asked a valid topical question,
responses to which would be educational to any
other 'newbies' reading.

You must have learned something then.

How does this make Herrcho an 'ass'?

He's not --you are!


You, however, look like an inconsiderate jerk who cannot
even spell simple English words.

The only accurate thing you've said so far. I am a jerk. I am
inconsiderate, and unlike you I don't use spell checkers.



**** you.


And you too.

clord
 
P

Peter Shaggy Haywood

Trolling square clod was jivin' on Thu, 18 Sep 2003 23:26:06 GMT in
comp.lang.c.
Re: about Pointer's a bad trip! Dig it!
Rational? I think you are making assumptions, or what we might refer to
as "hasty generalizations".


Again, you are wrong. My tone is one of mirth, not insult. To be

No, your tone is one of obnoxious insult.
absolutely clear, I was joking! I was trying to highlight how much of a

If you were joking, then I (for one) fail to get it. You blatantly
called the OP an ass. AFAICS, the only assinine person here is you,
Clod.
jerk everybody else in this newgroup is.

You highlighted yourself, Clod, only yourself. You called attention
to your own idiocy. But, like idiots everywhere, you seem unable to
see yourself for what you really are.
Now that was funny!

No, Clod, that was insulting. If you thought that was funny, then
you must be seriously disturbed. You need urgent psychiatric help.
You must have learned something then.

I bet he learned that you are an idiot and a troll, and that you are
not worth wasting any more effort listening to.
He's not --you are!

Then why did you call him an ass, Clod?
The only accurate thing you've said so far. I am a jerk. I am

Everything Mike has said so far is accurate.
inconsiderate, and unlike you I don't use spell checkers.

You would be wise to start using one, then, Clod. I don't think Mike
uses one, though. I don't think he needs one. (I could be wrong,
though.)
**** you.

And since he has plonked you, your foul-mouthed insult will fall on
deaf ears, so to speak. But everone else in this newsgroup will see
what an obnoxious dick you really are.
Go away, Clod, you troll, until you learn to conduct yourself with
proper decorum.
And you too.

And him too what?
 

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
474,079
Messages
2,570,575
Members
47,207
Latest member
HelenaCani

Latest Threads

Top