Pam McA'Nulty <[email protected]> added the comment:
In the example code, the 'result' variable is declared on the stack in the
callback() function. So it will be effectively when callback() returns.
Also the "result" variable in main() is never referenced. A pointer main()'s
"result" variable should be passed to callback() as an argument ("&result") and
`callback(struct helloStruct *result)` should populate it (via `result->i =
10;` etc)
```struct helloStruct callback () {
struct helloStruct result;
result.i = 10;
result.f = 3.14159;
return result;
}```
----------
nosy: +Pam.McANulty
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue5710>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com