Re: scratch memory
- From: Michael Mair <Michael.Mair@xxxxxxxxxxxxxxx>
- Date: Mon, 13 Feb 2006 19:09:03 +0100
Jordan Abel wrote:
On 2006-02-11, pete <pfiland@xxxxxxxxxxxxxx> wrote:<snip>
Mark McIntyre wrote:
C has no concept of "main memory" or "fast memory". What C /does/ have
is differing durations and differing scopes.
"scope" comes in two flavours of interest, file-scope, which most
people think of as global, and block-scope. The latter refers to
variables declared inside functions or inside blocks inside functions,
ie somewhere between a { and a }.
Parameters in function prototypes have function prototype scope,
and parameters in old style function definitions
have function scope.
What scope do parameters in function prototypes that are part of a [new
style] function definition have?
Block scope.
"function prototype scope" appears at
first glance to mean that they're not in scope in the function body.
Yep.
C99, 6.2.1#4
"[...] If the declarator or type specifier that declares
the identifier appears inside a block or within the list
of parameter declarations in a function definition, the
identifier has block scope, which terminates at the end
of the associated block. If the declarator or type
specifier that declares the identifier appears within
the list of parameter declarations in a function
prototype (not part of a function definition), the
identifier has function prototype scope, which
terminates at the end of the function declarator. [...]"
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
.
- References:
- scratch memory
- From: hurry
- Re: scratch memory
- From: Walter Roberson
- Re: scratch memory
- From: dave windsor
- Re: scratch memory
- From: Walter Roberson
- Re: scratch memory
- From: dave windsor
- Re: scratch memory
- From: hurry
- Re: scratch memory
- From: Mark McIntyre
- Re: scratch memory
- From: pete
- Re: scratch memory
- From: Jordan Abel
- scratch memory
- Prev by Date: Re: Save BMP images through C
- Next by Date: Re: String pointers and string arrays
- Previous by thread: Re: scratch memory
- Next by thread: Re: scratch memory
- Index(es):
Relevant Pages
|