Can global variable be passed into Python function?

random832 at fastmail.us random832 at fastmail.us
Mon Feb 24 13:20:14 EST 2014


On Mon, Feb 24, 2014, at 13:05, j.e.haque at gmail.com wrote:
> typedef struct {
>   int value;
> } Number;
> 
>   Number *o;
>   o = malloc(sizeof(*o));
>   o->value=3;
>   printf("o<%p>, o->value<%p>\n", o, &o->value);
> 
> o<0x9fe5008>, o->value<0x9fe5008>
> 
> Is the compiler borked?

That's cheating. Try printf("o<%p>", &o);



More information about the Python-list mailing list