What are Characters? - C Data Type

C examples for Data Type:Introduction

Introduction

Character data types are representations of integer values as character codes.

For example, the character code 90 represents the letter Z.

The character code 122 represents the lowercase letter z.

Characters can represent numbers 0 through 9, special characters such as the asterisk (*), and keyboard keys such as the delete key and escape key.

There are a total of 128 common character codes (0 through 127).

They make up the most commonly used characters of a keyboard.

Character codes are most notably organized through the ASCII character set.

ASCII stands for American Standard Code for Information Interchange.

Character variables are created using the char keyword.

Demo Code

#include <stdio.h> 
int main() //w  w  w. j  av  a  2 s  .  c o m
{ 
    char firstInitial; 
    
    char middleInitial; 
    
    char lastInitial; 

    printf("three char values declared."); 
} 

Result

Character constant must be enclosed in single quotes '.


Related Tutorials