osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can global variable be passed into Python function?


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);