【发布时间】:2016-10-16 15:01:19
【问题描述】:
我可以知道有什么问题吗?
for ( ; *line[0]; ++line[0], ++p->title) p->title = tolower(*line[0]);
p 是 struct,title 是 char 指针,line 是 string/char 指针
typedef struct p{
char *title;
} p;
我正在尝试将字符串转换为全部小写。
【问题讨论】:
-
您应该为
p发布struct的声明。p->surname是什么? -
@TedHopp 我已经发布了
struct和p->surname的声明是一个错字 -
请发布来自编译器的确切错误消息。
-
@JohnBode
lvalue required as increment operand for for ( ; *line[0]; ++line[0], ++p->title) p->title = tolower(*line[0]);