{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Educn numericlimits include limits include iostream

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: [email protected] 字符类型 char, signed char, unsigned char char和int之间的相互转换(由实现决定) wchar_t类型,用于保存更大的字符集里的 字符,如Unicode,具体大小由实现决定, 该名字来源于C语言,是一个typedef 对于字符类型可以进行算术和逻辑运算 字符文字量(字符常量),如’a’,’0’,’\n’等 宽字符文字量形式为L’ab’,引号中的字符个 数由wchar_t决定,其类型是wchar_t Beijing University of Posts & Telecommunications Beijing [email protected] 字符类型示例 八进制 十六进制 十进制 ASCII 大字符集 \6 \x6 6 ACK \uXXXX 或者 \UXXXX \60 \x30 48 ‘0’ \u1e2b \137 \x05f 95 ‘_’ \uXXXX等价于\U0000XXXX char char char char v1 v2 v3 v4 = = = = “a\xah\129”; “a\xah\127”; “a\xad\127”; “a\xad\0127”; Beijing University of Posts & Telecommunications Beijing [email protected] 字符类型程序示例 char c = 255; // 0xff int i = c; 问题:i = ? 解决方法:使用unsigned char 或者 signed char标明 但是有些函数只接受普通char类型 void f(char c, signed char sc, unsigned char uc) { char* pc = &uc...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern