Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>char character data type</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
char                     Character Data Type

    The char type declares an object to be of "plain" integral character
    type.  A char object is large enough to store any character in the
    host character set.  Whether or not the character is signed or
    unsigned is implementation-defined.

      Notes:    In MS-C, the character set is ASCII and the size of a
                char object is eight bits.  A char may contain any 8-bit
                representation, not just the ASCII characters; note that
                non-ASCII characters will be stored as a negative number,
                since "plain" chars are signed by default.  That is, char
                is equivalent to signed char and its range of values is -
                128 to 127, inclusive.  "Plain" chars may be made
                unsigned using the /J compile-time switch.

                One of the keywords signed and unsigned may be used as a
                prefix to char to identify the character as being signed
                or unsigned, respectively.

                By definition, sizeof(char) is one.

                When a char is used as a function argument, it is first
                promoted to an int.


  -------------------------------- Examples --------------------------------

           char value = 6;
           char action_code = 'A';
           char bit_pattern = '\xAB';
           char birth_date[7];
           char *pointer_to_char;
           char function();

           value = (char) 12345;

See Also: Types signed unsigned Switches

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson