(C++) Bit operation

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) Bit operation

 

Code snippets for if you need to work with bits.

 

  1. Convert Gray code to int, GrayToInt
  2. Convert int to a std::string of zeroes and ones, IntToBitString
  3. Convert int to Gray code, IntToGray
  4. Get Gray codes, GetGrayCodes
  5. GetGrayCodes, Get Gray codes
  6. GrayToInt, convert Gray code to int
  7. IntToBitString, convert int to a std::string of zeroes and ones
  8. IntToGray, convert int to Gray code