Re: Ahead of "main"?
- From: "J. J. Farrell" <jjf@xxxxxxxxxx>
- Date: 29 Apr 2007 16:04:05 -0700
On Apr 29, 2:35 pm, "Stephen Sprunk" <step...@xxxxxxxxxx> wrote:
"mdh" <m...@xxxxxxxxxxx> wrote in message
news:1177877117.874830.65670@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,
Going quite methodically through K& R ( as some of you can attest
to!), I have never seen a big diffference in declaring a function
within "main" or "ahead" of it. Now, (p119, K&R II), the discussion
states that "functions "whatever" " should be declared ahead of
main.
Is there a good reason for this?
In Standard C, functions cannot be declared "within" main(); these are
called nested functions ...
No, they're called function declarations are are certainly allowed
within main() and any other function. You're confusing declaration
with definition. You can't define a function within another function
in Standard C.
.
- References:
- Ahead of "main"?
- From: mdh
- Re: Ahead of "main"?
- From: Stephen Sprunk
- Ahead of "main"?
- Prev by Date: Re: two meanings of a cast
- Next by Date: Re: break statement in a for loop
- Previous by thread: Re: Ahead of "main"?
- Index(es):
Relevant Pages
|