Is there any function in c++ to convert decimal number to binary number without using divide algorithm?
I want to count different bits of binary format of 2 numbers. like diff(0,2) is 1 bit. or diff(3,15) is 2 bit.
I want to write diff function.
thanks
Is there any function in c++ to convert decimal number to binary number without
Share
You can find the number of different bits by counting the bits in the xor of the two numbers.
Something like this.