p>For example what does this mean?array[1] = (char)0;推荐答案这是C样式的强制转换。也就是说,它将 0 (这是类型为 int 的文字)转换为 char ( \0 字符)。只需使用'\0'文字就可以完全避免这种转换。It's a C-style cast. That is, it converts 0 (which is a literal of type int) to char (the \0 character). That cast could have been avoided entirely by simply using the '\0' literal. 这篇关于(char)0在C ++中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-19 12:11
查看更多