【发布时间】:2018-07-18 04:50:38
【问题描述】:
代码给了我错误:lvalue required as increment operand
但如果我将str 加 1,它必须指向字符串中的下一个字符。
#include <stdio.h>
#include <stdlib.h>
int main()
{
char str[50];
scanf("%s", str);
while(*str != 0)
{
printf("%c", *str);
str++;
}
return 0;
}
【问题讨论】:
-
这与C++无关,所以请不要使用C++标签。
-
...除非您使用 C++,否则不要使用 C 标签。请在应用之前阅读标签的描述!