For given n inputs, I need to generate all possible input combinations using C++
eg. n =4
I need to get,
1010101010101010
1100110011001100
1111000011110000
1111111100000000
(EDIT : In case this is not clear, these are the input combinations read column-wise)
I need these to perform operations like & and | so it would be best if I get them in their integer representation as n different variables.
I tried doing it using bitset for 32 input combinations but it took a long time to process. I was hoping if you guys had any ideas on a better implementation?
EDIT : Example when n=3
10101010
11001100
11110000
Here is a short implementation that generates that output: