junky_fellow wrote:
What is a C object ?
N869
3.15
[#1] object
region of data storage in the execution environment, the
contents of which can represent values
If i have some function "func()" in my C program, then
can i say that "func()" is a C object ?
No.
or if i have some function pointer (ptr) which contains the address
of function "func()",
can i say that ptr is pointing to some C object ?
No.
Is a C object always associated with some "data" ?
Normally, yes, though I suppose you could malloc some memory and
free it immediately if you wanted to, without involving any data.
Examples of objects are:
local variables,
external variables,
the memory returned by malloc and friends,
and string literals in a pointer context, refer to objects
When accessed by an identifier of object type,
objects can contain values.
The sizes of various types defined by the language,
are implementation defined.
Functions are not objects. The standard doesn't say very much
about how functions are represented in memory.
The address, is the only addressable byte of a function.
You don't know anything about how the rest of the function
resides in memory.
The sizeof operation is not defined for functions.
--
pete