|
 |
On 15 Sep 2000 02:46:13 -0400, Warp wrote:
>Peter J. Holzer <hjp### [at] sikitu wsr ac at> wrote:
>: No, only function *declarations* inside other functions are permitted,
>: but not function *definitions*.
>
> I meant what you are saying, ie. declaration. I know that you can't put
> the body of the function inside another function.
> I really don't know the difference between the words "declaration" and
> "definition".
In C, a declaration tells the compiler what a "thing" (an object[1] or a
function) looks like, while a definition creates it. Every definition
is also a declaration, but not vice versa.
> Usually when I have to refer to the body of the function I use
>the word "implementation". It may be wrong, though.
No it isn't wrong. It just isn't the word used when one talks about the
C programming language. Modula-2 for example has "definition modules"
and "implementation modules". Obviously when someone talks about a
"definition" in a modula program, he means something else than someone
talking about a "definition" in a C program.
Unfortunately, often a single word is used for different concepts, and
different words are used for the same concepts. What is meant has to be
guessed from context.
hp
[1] Just as another example: An "object" in C is just a place to store
values (either a variable or a malloced area). It has nothing to do with
object-oriented programming.
--
_ | Peter J. Holzer | access ist als datenbankserver fraglos noch
|_|_) | Sysadmin WSR | ungeeigneter als beispielsweise EDIT.COM,
| | | hjp### [at] wsr ac at | und das primaer aufgrund der erzeugung
__/ | http://www.hjp.at/ | falscher erwartungshaltungen. frank paulsen
Post a reply to this message
|
 |