Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>_rotl() rotate a value to the left</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _rotl()                 Rotate a Value to the Left

 #include <stdlib.h>

 unsigned   _rotl(value,count);
 unsigned   value;
 int        count;

    _rotl() rotates an unsigned 'value' to the left by 'count' bits.

       Returns:     The rotated value.

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

    The following statements rotate 'val' by 'count' bits.

           #include <stdlib.h>

           main()
           {
              unsigned val = 0xAA;
              int count = 1;

           printf("rotate %04X %d bit(s) = %04X\n",
                         val,count,_rotl(val,count));
           }


See Also: _lrotl() _lrotr() _rotr()

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