首页
mac
it
登录
6mi
u
盘
搜
搜 索
it
C语言 malloc strlen 一起使用时的注意事项
C语言 malloc strlen 一起使用时的注意事项
mac
2024-05-12
34
p = malloc(strlen(str)+1)
字符串实际占用大小比strlen求出的字符数多1个(字符串结尾的0也要占用空间),所以需要申请strlen(str)+1个单元
转载请注明原文地址: https://mac.8miu.com/read-491049.html
最新回复
(
0
)