今天在看c++primer的时候,读到其中这样一段话: When we use an istream as a condition, the effect is to test the state of the stream. If the stream is validthat is, if it is still possible to read another input then the test succeeds. An istream becomes invalid when we…
二.第四章 复合类型 1.C-风格字符串:C-风格字符串具有一种特殊的性质:以空字符结尾,空字符被写成\0,其ASC||编码为0,用来标记字符串的结尾.例如: char dog[5]={'b','e','a','u','x'}; // not a string! char cat[5]={'f','a','t','s','\0'}; // a string! 这两个数组都是char数组,但只有第二个数组是字符串.空字符串对C-风格字符串至关重要.如果使用coiut显示上面的cat这样的字符串…