O'Reilly logo

Mastering Arduino by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Character

The char data type is usually described as the data type that stores a character, however, this is not technically correct. The char data type stores a character as a numeric value based on the ASCII chart. When a char variable is defined, it can be defined with either the number that represents the character or the character itself as shown in the following code:

char myChar = 'A';
char myChar = 65;

In the preceding code, both lines declare a variable named myChar of the char type with a capital A as the value. Having a type that can hold only a single character is useful, but it would be more useful if we could store entire words or sentences. Later in this chapter, we will see how we can store words or sentences by using an array ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required