Name | Char字符 | ||||||
Examples | char m; // Declare variable ‘m’ of type char m = ‘A’; // Assign ‘m’ the value “A” int n = ‘&’; // Declare variable ‘n’ and assign it the value “&” |
||||||
Description | Datatype for characters, typographic symbols such as A, d, and $. A char stores letters and symbols in the Unicode format, a coding system developed to support a variety of world languages. Each char is two bytes (16 bits) in length and is distinguished by surrounding it with single quotes. Character escapes may also stored as a char. For example, the representation for the “delete” key is 127. The first time a variable is written, it must be declared with a statement expressing its datatype. Subsequent uses of this variable must not reference the datatype because Processing will think the variable is being declared again. 字符的数据类型、版式符号 (如 a、d 和 $)。char 以 unicode 格式存储字母和符号, 它是为支持各种世界语言而开发的编码系统。每个 char 是两个字节 (16 位) 的长度, 并通过围绕它与单引号。字符转义符也可以存储为 char。例如, “删除” 键的表示形式为127。第一次写入变量时, 必须用表达其数据类型的语句声明它。此变量的后续使用不能引用该数据类型, 因为处理将认为该变量正在再次声明。 |
||||||
Syntax语法 | char var char var = value |
||||||
Parameters 参数 |
|
||||||
Related 相关 |
String |
- 本文固定链接: http://iprocessing.cn/2017/07/15/char字符/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表