Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_lrotl() shift a long int to the left</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _lrotl()                Shift a Long Int to the Left

 #include   <stdlib.h>

  unsigned long _lrotl(value, shift);
  unsigned long value;   Value to be rotated
  int shift;             Number of bits to shift

    _lrotl() rotates value to the left by shift bits.

    Returns:    _lrotl() returns the rotated value. There is no error
                return.

      Notes:    Bits shifted off the left re-enter on the right, unlike
                the C shift operator (<<) which fills the vacated bits
                with 0's.

   Portability:     MS-DOS only

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


 This program shifts the hex value 0x12345678 eight bits (two hex digits) to
 the left and prints the output ( 0x34567812 )

           #include <stdlib.h>

           main()
           {
              unsigned long value = 0x12345678;
              printf("_lrotl(%lX, 8) = 0x%8.8lX\n", value, _lrotl(value, 8));
           }


See Also: _lrotr() _rotl() _rotr()

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