long                     Long Integer Data Type
 
    The keyword long may be applied to the int and float types.  The long
    int type declares an object to be of "plain" integral type.  The size
    (and representation) of a long int object is implementation-defined;
    however, a long int is guaranteed to be the same or greater in size
    than an int.  Whether a "plain" long int is signed or unsigned is
    implementation-defined.  The type long float is an archaic synonym
    for the type double.
 
      Notes:    In Turbo C, the size of a long int object is four bytes,
                and "plain" long ints are signed.  That is, long int is
                equivalent to signed long int and its range of values is
                -2147483648 to 2147483647, inclusive.  Long float,
                double, and long double are all the same size, eight
                bytes.
 
                One of the keywords signed and unsigned may be used as a
                prefix to long int, to identify the long integer as being
                signed or unsigned, respectively.
 
                If long is used without the keyword int or float, int is
                assumed.
 
                An integral constant with the suffix L (or l) is
                interpreted as a long int constant, as is any integral
                constant that is too big to be represented in an int.
 
                The ANSI C Standard has dropped support for long float as
                a synonym for double. Therefore, it is suggested you not
                use this archaic type.
 
  -------------------------------- Example ---------------------------------
 
           long int value = 6;
           long action_code = 'A';
           long int bit_pattern = '\xAB';
           long int counters[6];
           long *pointer_to_long_int;
           long int function();
 
           value = (long int) 123.45;
           value = (long) 123.45;
           value = 1234567L;
           value = 1234567l;
 
           long float average = 345.67;
 
           average = (long float) 1234;

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster