Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
首先,
ptr
初始化得太早,而argv[1]
不可用。其次,
main
局部变量run
与用于设置ptr
的全局run
无关,该全局变量在中使用>玩具1
。由于我们不知道
toy
是什么,我们无法回答更多。 8-DK 答案是一种可能性。First,
ptr
is initialised too early, at a time whereargv[1]
is not available.Second,
main
local variablerun
is not related to globalrun
used to setptr
that is used inToy1
.As we don't know what
toy
is we can not answer much more. 8-DK answer's is one possibility.这是我测试过的代码。试试这个
Here is the code I have tested. Try this