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++ Language Reference - _rotl, _rotr http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   _rotl, _rotr

   Usage
   #include <stdlib.h>
   unsigned int _rotl(unsigned int val, int shift);
   unsigned int _rotr(unsigned int val, int shift);

   Description
   The  functions  _rotl  and _rotr carry out a binary  rotation  of  the
   supplied unsigned integer, val, by shift bits.

   Example
   #include <stdio.h>
   #include <stdlib.h>

   main()
   {
   unsigned int 0x01234;

        printf("_rotl(value,4) = 0x%4.4x\n", _rotl(value,4));
        printf("_rotr(value,8) = 0x%4.4x\n", _rotr(value,8));
   }

   Return Value
   Both  of these functions return the rotated value as an unsigned  int.
   There is no error return.


See Also: _lrotl _lrotr

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