c++ - I have a character array, i want to shift the bits of it at binary level in right direction by one? -
i have character array, want shift bits of @ binary level in right direction one?
char arr[]="this array";
like above array represented in memory in binary form '110010101001110101......' want have program shift whole array?
just use <<
operator:
char arr[]="abc"; cout << *(bitset<24>*)arr << endl; cout << (*(bitset<24>*)arr << 1) << endl;
Comments
Post a Comment