I'm using c++ but really just need an idea how to do this I should be able to come up with my own code. I know there are 112 possible combinations, but I'm trying to find a way to generate them all possibly an array without having to do it manually. it doesn't have to be an array, I can easily make it an array if needed, just need to generate all the binary numbers between 0 and 128 containing exactly 5 on bits.
bool/int bit[8];
whatever works where
bit[7]+bit[6]+bit[5]+bit[4]+bit[3]+bit[2]+bit[1]+bit[0]=5;
bool/int bits[8][112];
trying to figure out how to do this in a loop I've been googling and haven't found anything close to what I'm trying to do, any help will be greatly appreciated.