sizeof()函数输出字符串长度时会把结束符计算在内; strlen()函数输出字符串长度时不会把结束符计算在内。 如图: 转载于:https://www.cnblogs.com/audi-car/p/4385617.html