欢迎24级新生
运行 ID 作者 题号 测评结果 分数 时间 内存 语言 代码长度 提交时间
17749 vera 1004 - 字符串拼接 编译错误 0 0 MS 0 KB C++ 753 1年前
暂时无法获取本题测试点详情。

Main.cc: In function 'int main()':
Main.cc:18:28: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
18 | strings[i] = malloc(strlen(temp) + 1);
| ~~~~~~^~~~~~~~~~~~~~~~~~
| |
| void*
Main.cc:22:26: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
22 | char *result = malloc(1);
| ~~~~~~^~~
| |
| void*
Main.cc:26:25: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
26 | result = realloc(result, strlen(result) + strlen(strings[i]) + 1);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void*
Main.cc:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
8 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
Main.cc:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
17 | scanf("%s", temp);
| ~~~~~^~~~~~~~~~~~