Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的代码有问题。我想将 char 数组解析为 char 指针;我该怎么做?
示例代码:
char tmp[1000]; char *temp; gets(tmp);
如何将 char tmp 解析为 char *temp?
问候,
如果您的意思是指向temp,tmp这应该有效。
temp
tmp
char tmp[1000]; char *temp; temp = &tmp[0];
如果你想复制,你可能需要做更多的工作。