initiate bitset with an integer declared in my function in c++

37 Views Asked by At

I want to do

    int count=32;
    bitset<count>(a);

I have not put my entire code as it was irrelevant the basic thing is that I have to create a bitset of a given length and that length is calculated in the program. But this throws an error showing count cannot appear in a constant expression. What would be the solution to this.

0

There are 0 best solutions below