I have a quick question which may be very basic, but I'm new in C++ and appreciate a lot if any one helps me with this:
suppose I have a string of binary values of the length = 1142 and I want the first 20 values stay binary but make the rest (for i=21 to 1142) convert to integer values (each 3 binary values of the string creates an integer number).
How can I code this?
To convert 3 booleans to an int, write my_int = my_bool[0] + my_bool[1]<<1 + my_bool[2]<<2; to loop from 21 to 1142 with a strep of 3 write for(int i = 21; i < 1142; i += 3){...}.
Now combine these two and it should work.