QP School
Storing a single character in C - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: C 18 Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=32)
+--- Thread: Storing a single character in C (/showthread.php?tid=5135)



Storing a single character in C - Qomplainerz - 07-26-2023

Description:

Sure! The char data type in C is used to store single characters, such as letters, digits, or symbols. It is the smallest basic data type and occupies 1 byte in memory. It can hold both positive and negative values, as well as special characters.

Example:

char ch = 'A';

Explanation:

In this example, we declare a variable ch of type char.
We initialize it with the character 'A'.
The character is enclosed in single quotes to indicate that it is a character literal.