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.
我对C很陌生(多年后)。我正在使用 lcc64 并有以下声明
char *logMessage = strdup(argv[1]);
我不知道为什么我会收到错误
"operands of = have illegal types 'pointer to char' and 'int"
有什么建议么?
您需要将<string.h>strdup() 声明为返回 char*,否则编译器认为它返回一个 int
<string.h>