Reference.Char History

Hide minor edits - Show changes to markup

June 01, 2010, at 12:20 PM by Equipo Traduccion -
Changed lines 3-14 from:

Description

A data type that takes up 1 byte of memory that stores a character value. Character literals are written in single quotes, like this: 'A' (for multiple characters - strings - use double quotes: "ABC").

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. This means that it is possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println reference for more on how characters are translated to numbers.

The char datatype is a signed type, meaning that it encodes numbers from -128 to 127. For an unsigned, one-byte (8 bit) data type, use the byte data type.

Example

[@ char myChar = 'A';

  char myChar = 65;      // both are equivalent
to:

Descripción

Es un tipo de dato que ocupa un byte de memoria y almacena un valor de carácter. Los carácteres literales se escriben con comillas simples: 'A' (para varios carácteres -strings- utiliza dobles comillas "ABC").

De todas maneras los carácteres son almacenados como números. Puedes ver su codificado en la tabla ASCII. Con esto podemos entender que es posible realizar cálculos aritméticos con los carácteres, en este caso se utiliza el valor ASCII del carácter (por ejemplo 'A' + 1 tiene el valor de 66, ya que el valor ASCII de la letra mayúscula A es 65). Mira Serial.println para tener mas información de como son traducidos a números los carácteres.

El tipo de datos char tiene signo. esto significa que codifica números desde -128 hasta 127. Para un dato de un byte (8bits), utiliza el tipo de dato "byte".

Ejemplo

[@ char miChar = 'A';

  char miChar = 65;      // los dos son equivalentes
Changed lines 18-19 from:

See also

to:

Mira también

September 06, 2008, at 09:14 PM by Paul Badger -
September 06, 2008, at 09:13 PM by Paul Badger -
Changed line 13 from:

[@char myChar = 'A';

to:

[@ char myChar = 'A';

September 06, 2008, at 09:13 PM by Paul Badger -
Changed line 14 from:
 char myChar = 65;      // both are equivalent
to:
  char myChar = 65;      // both are equivalent
September 06, 2008, at 09:13 PM by Paul Badger -
Changed lines 13-14 from:
    [@char myChar = 'A';
 [=char myChar = 65;      // both are equivalent
to:

[@char myChar = 'A';

 char myChar = 65;      // both are equivalent
September 06, 2008, at 09:12 PM by Paul Badger -
Changed lines 13-14 from:
    char myChar = 'A';
to:
    
char myChar = 'A';
 [=char myChar = 65;      // both are equivalent
September 08, 2007, at 04:22 PM by Paul Badger -
Changed lines 7-8 from:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is also possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println reference for more on how characters are translated to numbers.

to:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. This means that it is possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println reference for more on how characters are translated to numbers.

July 20, 2007, at 01:11 AM by David A. Mellis -
Changed lines 9-10 from:

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127. For an unsigned, one-byte (8 bit) data type, use the byte data type.

to:

The char datatype is a signed type, meaning that it encodes numbers from -128 to 127. For an unsigned, one-byte (8 bit) data type, use the byte data type.

July 19, 2007, at 03:12 AM by Paul Badger -
Changed lines 9-10 from:

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127. For an unsigned, one-byte (8 bit) data type, use the byte data type.

to:

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127. For an unsigned, one-byte (8 bit) data type, use the byte data type.

July 19, 2007, at 03:12 AM by Paul Badger -
Changed lines 9-10 from:

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127. For an unsigned, one-byte (8 bit) data type, use the !!!byte data type.

to:

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127. For an unsigned, one-byte (8 bit) data type, use the byte data type.

July 19, 2007, at 03:11 AM by Paul Badger -
July 19, 2007, at 03:09 AM by Paul Badger -
Changed lines 9-10 from:

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127.

to:

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127. For an unsigned, one-byte (8 bit) data type, use the !!!byte data type.

July 19, 2007, at 03:05 AM by Paul Badger -
Changed line 20 from:
to:
July 19, 2007, at 03:04 AM by Paul Badger -
Changed lines 7-8 from:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is also possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println? reference for more on how characters are translated to numbers.

to:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is also possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println reference for more on how characters are translated to numbers.

July 19, 2007, at 03:03 AM by Paul Badger -
Changed lines 7-8 from:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is also possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println? reference for more on how characters are translated to numbers.

to:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is also possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println? reference for more on how characters are translated to numbers.

July 19, 2007, at 03:03 AM by Paul Badger -
July 19, 2007, at 03:02 AM by Paul Badger -
Changed lines 7-8 from:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is aslo possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See the [[Serial.println example for more on how this works.

to:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is also possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See Serial.println? reference for more on how characters are translated to numbers.

The char datatype is a signed type, meaning that it encodes numbers from -127 to 127.

Added line 20:
July 19, 2007, at 02:48 AM by Paul Badger -
Changed lines 7-10 from:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is aslo possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. myChar ='A' + 1 has the value 66, since the ASCII value of the capital letter A is 65).

See the Serial.prinln example for more on how this works.

to:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is aslo possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See the [[Serial.println example for more on how this works.

July 19, 2007, at 02:47 AM by Paul Badger -
Changed lines 7-8 from:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart You can also do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65).

to:

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart. It is aslo possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. myChar ='A' + 1 has the value 66, since the ASCII value of the capital letter A is 65).

July 19, 2007, at 02:44 AM by Paul Badger -
Changed lines 5-6 from:

A data type that takes up 1 byte of memory that stores a character value. Character literals are written in single quotes, like this: 'A' (for multiple characters - strings - use double quotes: "ABC"). You can do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65).

to:

A data type that takes up 1 byte of memory that stores a character value. Character literals are written in single quotes, like this: 'A' (for multiple characters - strings - use double quotes: "ABC").

Characters are stored as numbers however. You can see the specific encoding in the ASCII chart You can also do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65).

See the Serial.prinln example for more on how this works.

May 29, 2007, at 05:21 AM by David A. Mellis -
Deleted lines 6-8:

Synonymous with type byte in Arduino.

May 29, 2007, at 03:06 AM by Paul Badger -
Changed lines 7-9 from:
to:

Synonymous with type byte in Arduino.

Changed lines 12-26 from:
    char sign = ' ';

Parameters

    char var = 'x';

  • var - your char variable name
  • x - the value (single character) you assign to that variable... ie: a, 4, #, etc.

to:
    char myChar = 'A';

See also

May 29, 2007, at 03:03 AM by Paul Badger -
Added line 7:
April 16, 2007, at 05:57 PM by Paul Badger -
Changed lines 1-2 from:

char

to:

char

Deleted lines 21-24:
August 01, 2006, at 01:55 PM by David A. Mellis -
Changed lines 5-6 from:

A data type that takes up 1 byte of memory that stores a character value.

to:

A data type that takes up 1 byte of memory that stores a character value. Character literals are written in single quotes, like this: 'A' (for multiple characters - strings - use double quotes: "ABC"). You can do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65).

Changed lines 13-14 from:
    char var = 'val';
to:
    char var = 'x';
Changed lines 16-22 from:
  • val - the value (single character) you assign to that variable... ie: a, 4, #, etc.

to:
  • x - the value (single character) you assign to that variable... ie: a, 4, #, etc.

March 31, 2006, at 10:54 PM by Jeff Gray -
Changed lines 1-2 from:

int

to:

char

March 31, 2006, at 10:53 PM by Jeff Gray -
Changed lines 1-8 from:
to:

int

Description

A data type that takes up 1 byte of memory that stores a character value.

Example

Changed lines 11-27 from:

A data type that takes up 1 byte of memory that stores a character value.

to:

Parameters

    char var = 'val';

  • var - your char variable name
  • val - the value (single character) you assign to that variable... ie: a, 4, #, etc.

Reference Home

February 14, 2006, at 04:54 PM by Erica Calogero -
Added lines 1-3:
    char sign = ' ';
February 14, 2006, at 04:53 PM by Erica Calogero -
Added line 1:

A data type that takes up 1 byte of memory that stores a character value.

Share