extern int32_T myinput;
extern int32_T myoutput;
extern void initialize(void);
extern void run(void);
extern void terminate(void);
void run(void)
{
myoutput = myinput * 2;
}
from ctypes import*
mydll = cdll.LoadLibrary("C:\\myDLL.dll")
mydll.myinput = 10 # Question1
mydll.initialize()
mydll.run()
print(mydll.myoutput) # Question2
mydll.terminate()
20
<_FuncPtr object at 0x00000000023646C8>
简而言之,您是否可以修改我的脚本以使输出为20?