记录详情

Accepted

foo.cc: In function 'void Concat(const char*, const char*, char*)':
foo.cc:9:9: warning: unused variable 'len2' [-Wunused-variable]
    9 |     int len2 = strlen(str2);
      |         ^~~~
foo.cc:12:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-truncation]
   12 |     strncpy(result, str1, len1 - 1);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:8:22: note: length computed here
    8 |     int len1 = strlen(str1);
      |                ~~~~~~^~~~~~
# 状态 耗时 内存占用
#1 Accepted 2ms 536.0 KiB
#2 Accepted 3ms 536.0 KiB
#3 Accepted 2ms 548.0 KiB
#4 Accepted 2ms 444.0 KiB
#5 Accepted 2ms 536.0 KiB

信息

递交者
类型
递交
题目
A8-4 字符串的连接函数
比赛
2024-3-22 信息教师练习赛(3)
语言
C++
递交时间
2024-03-23 11:43:35
评测时间
2024-03-23 11:43:35
评测机
分数
100
总耗时
14ms
峰值内存
548.0 KiB