Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>short short integer data type</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
short                    Short Integer Data Type

    The keyword short may be applied to the int type.  The short int type
    declares an object to be of "plain" integral type.  The size (and
    representation) of a short int object is implementation-defined; a
    short int, however, is guaranteed to be the same or less in size than
    an int.  Whether a "plain" short int is signed or unsigned is
    implementation-defined.

      Notes:    In Turbo C, the size of a short int object is two bytes
                and "plain" short ints are signed.  That is, short int is
                equivalent to signed short int and its range of values is
                -32768 to 32767, inclusive.

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

                If short is used without the keyword int, the int is
                assumed.

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

  -------------------------------- Example ---------------------------------

           short int value = 6;
           short action_code = 'A';
           short int bit_pattern = '\xAB';
           short int counters[6];
           short *pointer_to_short_int;
           short int function();

           value = (short int) 123.45;
           value = (short) 123.45;

See Also: long signed unsigned Types Type Modifiers

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