[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppChar

(C++) char

Data type (and thus a keyword) like int and double, that can hold a single character.

const char myChar = 'R';
std::cout << myChar << std::endl;


If you want to store more char's, then use a std::string [2,3] (C++ users only).

Prefer plain char over signed char and unsigned char [1,5]. Use string instead of an array of char[2,3].

The range of a char can be found at compile time with std::numeric_limits.

From [4]: How do you pronounce "char"?

"char" is usually pronounced "tchar", not "kar". This may seem illogical because "character" is pronounced "ka-rak-ter", but nobody ever accused English pronounciation and spelling of being logical.

'char' links

References



last edited (May 28, 2007) by bilderbikkel, Number of views: 6461, Current Rev: 17 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.