Ben Bacarisse said:
<snip lots>
Why do you have to be so angry?
I'm not really angry, but I am being trolled, as is anybody
who mistakenly wanders into this group thinking it is about
technical discussions related to the "C" programming
language. If I WAS a "bleeding-heart" about "newbies"
(think of the children!) like all of the hypocritical trolls
that infect the group, I WOULD be seething. It IS totally
reprehensible how the freaks here treat people who are
just trying to learn a programming language...and this
thread is a classic example...
There is a technical matter here so I
will get stuck in, but I am wary of getting caught in the middle of a
flame war.
Don't worry about that; remember that trolls like "Little Dick"
use a "hit-and-run" strategy of posting lies and then running
away to marvel at the chaos they've caused...but in the final
analysis, they're more pathetic than dangerous, EXCEPT
to the "newbies" (THINK OF THE CHILDREN!!!); they
can't really hurt an intelligent person, who should just ignore
them in the first place.
You must be aware that is this not the normal syntax.
Sure it is. I use it all the time, so it's normal to me.
Usually, the
function definition is similar to the declaration, except the ';' is
replaced by the function body.
Right. Let me clue you in on something about me: I try to
conserve keystrokes where they AREN'T needed, and use
them where they help me understand my own code.
Here, you have an odd-looking
parameter.
Sorry, but does your opinion of the color of a car's paint
affect how well it runs?
Function pointer parameters usually look like this:
void my_library_function(int (*my_callback_function)(const char*)) {}
Sure. But then I have to type "(*)" (three whole extra characters!)
where I don't need to type any more characters, because the two
ways of defining the parameters ARE TOTALLY FUNCTIONALLY
IDENTICAL.
which is, of course, how you wrote it in the function's prototype.
There, I'm forced to write it that way, unless I again want to
type unwanted characters...WHICH I DON'T.
This example *seems* to declare the parameter as a function, not a
pointer to one.
The key word, as you note, is "seems", since there is no
actual difference, despite how hard one of the "troll-ettes"
here has tried to convince innocent newbies otherwise.
This is why I feel pretty confident stating that most of the
posters here are technically incompetent (or they are just
shameless trolls, take your pick): they refer to "warnings"
as "errors" and "bugs", apparently not understanding the
meanings of those words in "C" programming, as well as
function names actually being, BY COMPLETE NECESSITY,
function pointers.
Nobody can make the mistakes that "troll zero" and
his "troll-ette" has made in this thread and not be justifiably
called technically incompetent (or again, just a troll, a
person who LIES to provoke newsgroup arguments; take
your pick).
The answer is that there is a special dispensation:
A declaration of a parameter as ''function returning type'' shall be
adjusted to ''pointer to function returning type''
Great, which of course completely conforms to the basic
idea above that a function name is actually a function pointer
by the simple necessity of computer science...I'm assuming
this is "standard" language, so despite you calling it a
"special dispensation" IT IS TOTALLY CONFORMING
"STANDARD" SYNTAX.
This is the same sort of special case that makes 'int x[]' be treated
as a pointer rather than an (un-passable) array. Your example is less
than clear for people learning the language or having trouble with
function pointers. I would not post it as an example to follow, but
it is correct.
Well, I'll give you this, you a) actually admitted it is "correct";
and b) gave an innocent "newbie" a fighting chance to be
able to write correct code despite all the misinformation and
sheer idiocy put out by "troll zero" and his "troll-ette"...of course,
since what I wrote was "correct" in the first place, it would
have been best had they just pointed out the "equivalency"
of function names and function pointers and showed the
simple "equivalent" function definition rather than all the juvenile
confusing trolling...
But I WARNED the "newbie" UP-FRONT that any "correct"
answer here would be trolled, so as usual, I'm "correct" about
EVERYTHING, but people even more so than programming...