Inserting a “£” sign in an output string in C++

前端 未结 4 1093
不思量自难忘°
不思量自难忘° 2021-01-06 00:10

I have the following code:

cout << \"String that includes a £ sign\";

However, the £ sign is not being recognised by the compiler, an

4条回答
  •  暖寄归人
    2021-01-06 01:05

    £ does not have an "ASCII code" - ASCII is 7 bits (0..127). There are various extended 8 bit characters sets which include £ but there is no single standard for this and the £ symbol may have various different values in different environments. You should probably be using Unicode if you need international symbols with maximum portability.

提交回复
热议问题