Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

The GNU C Programming Tutorial - The char type

Node:The char type, Next:, Previous:Integer variables, Up:Integer variables



The char type

char is a special integer type designed for storing single characters. The integer value of a char corresponds to an ASCII character. For example, a value of 65 corresponds to the letter A, 66 corresponds to B, 67 to C, and so on.

As in the table above, unsigned char permits values from 0 to 255, and signed char permits values from -127 (or -128) to 127. The char type is signed by default on some computers, but unsigned on others. (See Character conversion table. See Special characters.)

char is used only within arrays; variables meant to hold one character should be declared int. (See Strings, for more information on character arrays. See Cast operator demo, for an example of how to use an integer variable to hold a character value.)

 
 
  Published under free license. Design by Interspire