记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:24:28: error: 'strlen' was not declared in this scope
         p = (char *)malloc(strlen(A) + strlen(B));
                            ^~~~~~
foo.cc:24:28: note: suggested alternative: 'mblen'
         p = (char *)malloc(strlen(A) + strlen(B));
                            ^~~~~~
                            mblen
foo.cc:25:9: error: 'strcpy' was not declared in this scope
         strcpy(p, B);
         ^~~~~~
foo.cc:25:9: note: suggested alternative: 'strtoq'
         strcpy(p, B);
         ^~~~~~
         strtoq
foo.cc:26:9: error: 'strcat' was not declared in this scope
         strcat(p, A);
         ^~~~~~
foo.cc:26:9: note: suggested alternative: 'struct'
         strcat(p, A);
         ^~~~~~
         struct
foo.cc:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
foo.cc:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", s1);
     ~~~~~^~~~~~~~~~
foo.cc:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", s2);
     ~~~~~^~~~~~~~~~

信息

递交者
类型
递交
题目
2-2 语言的起点
语言
C++
递交时间
2021-01-21 19:44:54
评测时间
2021-01-21 19:44:54
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes