strlen如何为{'1','1'}和{'1','1','\ 0'}提供相同的输出?

use*_*898 0 c arrays null strlen

strlen()被null终止吧?那么当strlen(c)和strlen时,char c [] = {'1','1'}和char d [] = {'1','1','\ 0'}如何给出相同的输出2 (d)用过吗?

eca*_*mur 5

前者是未定义的行为; 它可以输出2,它也可以输出500,终止你的程序或破坏你的计算机.