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 - Characters

Node:Characters, Next:, Previous:Allocating memory for strings, Up:Bits and pieces



Characters

In C, single characters are written enclosed by single quotes. This is in contrast to strings of characters, which use double quotes ("...").

int ch;
ch = 'a';

would give ch the value of the character a. The same effect can also be achieved by writing:

char ch = 'a';

It is also possible to have the type:

unsigned char

This admits ASCII values from 0 to 255, rather than -128 to 127.

 
 
  Published under free license. Design by Interspire