QP School

Full Version: ASCII representation of characters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Example:

char uppercase_A = 65; // ASCII value of 'A'
char lowercase_a = 'a'; // ASCII value of 'a'

Explanation:

In C, char variables can hold numeric values that correspond to ASCII codes for characters.
In this example, we assign the integer value 65 to uppercase_A. The ASCII code 65 corresponds to the character 'A'.
We can also assign a character literal to lowercase_a. The ASCII code for lowercase 'a' is 97.