Open In App

unsigned char in C with Examples

char is the most basic data type in C. It stores a single character and requires a single byte of memory in almost all compilers.

Now character datatype can be divided into 2 types:



  1. signed char
  2. unsigned char

unsigned char is a character datatype where the variable consumes all the 8 bits of the memory and there is no sign bit (which is there in signed char). So it means that the range of unsigned char data type ranges from 0 to 255.



Syntax:

unsigned char [variable_name] = [value]

Example:

unsigned char ch = 'a';

Article Tags :