DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: what do the "<<" and ">>" operators do in this code

  1. #1
    Join Date
    Mar 2007
    Posts
    1

    what do the "<<" and ">>" operators do in this code

    Hi,

    I have got this code below and I do not know what the "<<" and the ">>" operator functionalities are. The code is;

    unsigned long nn;
    unsigned long n;

    nn = 512;

    n=nn << 1; //these are the 3 lines of code that I do not understand
    m=n >> 1;
    m >>= 1;

    Any help would be appreciated,
    Adam

  2. #2
    Join Date
    Dec 2003
    Posts
    3,366
    shift
    000001 in binary becomes
    000010 after a << etc

Similar Threads

  1. c# to vb .net help for the oprater ">>"
    By Javfarary in forum .NET
    Replies: 7
    Last Post: 12-14-2006, 01:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center