[OT] Can global variable be passed into Python function?
rosuav at gmail.com
Sun Mar 2 20:24:16 CET 2014
On Mon, Mar 3, 2014 at 3:55 AM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
> On 02/03/2014 16:45, Grant Edwards wrote:
>> That's irrelevent. The actual location of the memory containing the
>> struct object (static, stack, heap, shared) doesn't matter. The
>> address of the first field in a struture object _is_ the address of
>> the structure object.
> You say struture, I'll say structure, let's call the whole thing off :)
Note that, technically, Grant is correct as long as you grant (heh)
that a structure may have an invisible member, the virtual function
table pointer. C++ only (I don't believe C has virtual functions - but
it may have grown them in one of the newer standards), so in C, all
members are public.
With an array, the array's pointer *is* the same as the pointer to its
first member, because adding zero to a pointer does nothing, and x <->
&x <-> &(*(x+0)).
More information about the Python-list