CHAPTER 6

image

Characters

In this chapter, we will explain the following:

  • Some important features of character sets
  • How to work with character constants and values
  • How to declare character variables in C
  • How you can use characters in arithmetic expressions
  • How to read, manipulate, and print characters
  • How to test for end-of-line using \n
  • How to test for end-of-file using EOF
  • How to compare characters
  • How to read characters from a file
  • How to convert a number from character to integer

6.1 Character Sets

Most of us are familiar with a computer or typewriter keyboard (called the standard English keyboard). On it, we can type the letters of the alphabet ...

Get Learn to Program with C now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.