hi all, may i know how do i use ROL? eg,
ROL( EA01 ∩ 1201)
not sure how to write the code...
i am new to C programming and quite lost with all this stuff...thanks for all your help
hi all, may i know how do i use ROL? eg,
ROL( EA01 ∩ 1201)
not sure how to write the code...
i am new to C programming and quite lost with all this stuff...thanks for all your help
I'm guessing that ROL means "rotate left" (e.g., an assembly language instruction), but ∩ means "set intersection" to me, so I do not quite understand what it means in this context. Bitwise and? It certainly is not a C operator.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I believe that function would work. If needed to be adjusted for other machine word lengths, it's pretty straightforward.Code:#include <stdint.h> uint32_t rol32(uint32_t x, int32_t bits) { return x<<bits | x>>(32-bits); }
Last edited by xuftugulus; 03-13-2008 at 09:38 AM. Reason: Sign issues should be handled by user, changed int32_t to uint32_t
A typical example of ...cheap programming practices.Code:... goto johny_walker_red_label; johny_walker_blue_label: exit(-149$); johny_walker_red_label : exit( -22$);