sizeof与strlen区别

其中sizeof 和strlen的区别是:

strlen返回的是字符串的个数不包含/0

sizeof返回的是字节数 取决于所用的编译器和定义的类型:如下所示[1]

指针变量是pointer

参考:

[1] https://wenda.so.com/q/1449899708721467

[2]https://blog.csdn.net/SunnyYoona/article/details/39118465 该作者讲的很好!

猜你喜欢

转载自blog.csdn.net/heda3/article/details/82730349