Home   |   About   |   Terms   |   Contact    
A platform for writers

Signed char and Unsigned char in C++


☯ All C++ Articles     ☯ All Articles

Popular Google Pages:

◕ Send your story to RiyaButu.com and get ₹ 500/- Details..

◕ Bengali Story writing competition. Details..

◕ This article is regarding Signed char and Unsigned char in C++.
Last updated on: .

◕ What is Signed char and Unsigned char in C++?

- We know integer has the property Signed and Unsigned.
But, character is not Signed or Unsigned by default.
It depends on the Implementation or on the C++ Compiler Developer.

It depends on me whether I want to use character as Signed or Unsigned.
The example codes are given bellow:

▨ char bud; // may be signed, may be unsigned

▨ unsigned char flower; // definitely unsigned

▨ signed char bird; // definitely signed

If we use the char as numeric type then
- the signed char type typically represents from the range -128 to 127.
- the unsigned char type typically represents the range 0 to 255.

This means if we want to use a char as variable to hold values as large as 200.
Then we have to use unsigned char for its successful use on any system.

Related articles:
Integer Type in C++
Rules for Variable Names
Variable in C++
Fundamental Data Types & Compound Data Types
What is called Directive and Header File in C++ ?
What is Block Statement in C++ ?

Top of the page

Amazon & Flipkart Special Products


Top of the page