CHAPTER 13Basic Data Types
13.1 CHARACTERS AND STRINGS
In our daily interactions with computers, we see information represented as letters and words, such as user names and passwords, the documents that we write, and content of the internet websites. However, since the processor can only ‘understand’ binary numbers, C uses a standard called American Standard Code for Information Interchange (ASCII) that specifies how characters can be stored as numbers. For example, ‘A’ is represented as number 65, ‘B’ is represented as number 66 and so on.
C provides data type char to store an ASCII character. It is the smallest in size, and in most computers, it is 1 byte. The value of a character ranges from 0 to 255. (Certain compilers treat characters as a signed byte, in which case, its numeric ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access