C语言中,字符串长度包含⼀0么??

2025-03-18 22:47:12
推荐回答(1个)
回答1:

字符串占空间数包含\0 但是字符串长度(用strlen计算)不包含\0
比如"abcd"
对其做strlen返回4
但是做sizeof计算则返回5