这是代码片段。
char *arguments[ARGSIZE];
char *buf;
//Put stuff in buf and do whatever until
*arguments++ = buf;
似乎 *arguments++ 正在抛出错误,为什么这无效?
最佳答案
如果您需要通过数组进行这样的迭代,则需要额外的指针:
char *arguments[ARGSIZE];
char **ptr = &arguments[0];
char *buf;
//Put stuff in buf and do whatever until
*ptr++ = buf;
关于c++ - 执行赋值的赋值左值无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19904337/