Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C Java
What is the use of bitwise shift operators?Means where can we use in application?
Posted 13-Dec-12 20:22pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Sean Eron Anderson has a nice collection of Bit Twiddling Hacks[^] that illustrates their usefulness.

Regards
Espen Harlinn
  Permalink  
Comments
Mika Wendelius at 28-Dec-12 10:56am
   
Very useful!
Espen Harlinn at 29-Dec-12 7:22am
   
Thank you, Mika :-D
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
CPallini at 20-Dec-12 17:41pm
   
5.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

there are two types of bitwise operator->
1:Left Shift Operator- <<
2:Right Shift Operator- >>

Left Shift Operator:-
It is used to shift at left side,but depends on the length u will specify to shift.
Example- My number is-8,I want to shift it 2 place at left
First calculate binary of 8,it will be-1000 when u apply left Shift
with the lengthh of 2,means u want to left shift 2 place,then it will left shift ur binary format like- 100000 and now ur o/p will be decimal of 100000 means (32)

Right Shif Operator:- Same 1000 will be,with right shift operator with length 2 will become-0010 means (2)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

take a look at this:
this is refrence.

http://www.google.com/url?sa=t&rct=j&q=msdn+bitwise+shift&source=web&cd=1&cad=rja&ved=0CDMQFjAA&url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Ff96c63ed(v%3Dvs.80).aspx&ei=ZozTUL7DEYftsgats4D4DA&usg=AFQjCNHKOi9anCvNpE5rLJfeuH9eFng3CA&bvm=bv.1355534169,d.Yms
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sascha Lefévre 510
1 Sergey Alexandrovich Kryukov 300
2 Abhinav S 255
3 Maciej Los 210
4 Richard Deeming 105
0 Sergey Alexandrovich Kryukov 6,928
1 OriginalGriff 6,381
2 Maciej Los 2,782
3 Abhinav S 2,732
4 Peter Leow 2,694


Advertise | Privacy | Mobile
Web03 | 2.8.150414.1 | Last Updated 20 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100