Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是实践,有什么区别
ostream stream( ... );
和
basic_ostream<unsigned char> stream( ... );
处理二进制数据时?
如果您查看ostream标头中的声明,则应将其模板化char(通常默认情况下已签名)。显然它的大小与 a 相同unsigned char,因此它与原始二进制数据的行为方式相同。有符号/无符号的区别根本不影响底层表示或处理。
ostream
char
unsigned char