| | |
What do << and >> mean in cyclic shift hash codes?
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 25
Reputation:
Solved Threads: 0
In an assignment involving cyclic shift hash codes, the instructions include the following code:
What do the >> and << in line 4 mean?
C++ Syntax (Toggle Plain Text)
int hashCode(const char* p, int len) { unsigned int h = 0; for (int i = 0; i < len; i++) { h = (h << 5)|(h >> 27); h += (unsigned int)p[i]; } return h; }
What do the >> and << in line 4 mean?
•
•
Join Date: Feb 2008
Posts: 638
Reputation:
Solved Threads: 46
Here is a good explanation of left shift (<<) and right shift (>>)
http://irc.essex.ac.uk/www.iota-six...._operators.asp
Dave
http://irc.essex.ac.uk/www.iota-six...._operators.asp
Dave
![]() |
Similar Threads
- Keep a number as a byte? (C)
- Questions about Hash Tables and Chaining (C)
- Hashing Problem (C++)
- Sort items in ListBox by 3 conditions (C++)
- cyclic codes help (C++)
- hash() md5 and url encoding issue (ColdFusion)
- comparing elemets of arraylist (Java)
- using hash in perl objects (Perl)
- How to Hash and Store in Database (ASP.NET)
- java is supposed to be secure? (Java)
Other Threads in the C++ Forum
- Previous Thread: classes in c++ programming help?
- Next Thread: Effective member function calls
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets





