Posted By: alibaba
pointer in a function containig wait - 04/07/18 12:38
It's been some time since I've used 3DGS so it might be a stupid question.
(Code may contain errors since I've just typed from the top of my head)
This example gives me a "5" instead of a "6". Are pointers lost when using waits in a function? Is there a workaround?
(Code may contain errors since I've just typed from the top of my head)
Code:
void foo(int* i) { *i=5; wait(1); *i=6; } void main() { int a=0; foo(&a); wait_for(foo); printf("%d", a); }
This example gives me a "5" instead of a "6". Are pointers lost when using waits in a function? Is there a workaround?