char type

   
char type Character type specifier

  simple-type-specifier  := char 

figs/acorn.gif

The char type represents a character, sometimes called a narrow character. The char type is distinct from signed char and unsigned char , but its representation must match one or the other. (Which one depends on the implementation.) A char can be promoted to an integer; the value depends on whether the representation is signed or unsigned.

By definition, sizeof(char) is 1 , so a char is often used as the basic unit of memory allocation. Raw memory is often allocated as arrays of char or unsigned char .

See Also

type , wchar_t , Chapter 1, Chapter 2, <cstring> , <memory>

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net