第2章 C语言基础.pptVIP

  • 1
  • 0
  • 约7.42千字
  • 约 66页
  • 2020-02-26 发布于福建
  • 举报
字符串连接运算符 + + 除用于算术加法运算外,还可用于对字符串进行连接操作 int i = 300 +5; string s = hello, + world!; +运算符两侧的操作数中只要有一个是字符串(String)类型,系统会自动将另一个操作数转换为字符串然后再进行连接 string s = hello, +300 + 5 + 号; //输出:hello, 3005号 逻辑运算符(1) 逻辑运算符功能 !-- 逻辑非 -- 逻辑与 | -- 逻辑或 ^ -- 逻辑异或 -- 短路与 || -- 短路或 逻辑运算符功能说明: a b !a ab a|b a^b ab a||b true true false true true false true true true false false false true true false true false true true false true true false true false false true false false false false false 逻辑运算符(2) 短路(short-circuit)逻辑运算符应用 -- 第一个操作数为假则不判断第二个操作数 || -- 第一个操作数为真则不判断第二个操作数

文档评论(0)

1亿VIP精品文档

相关文档