سؤال

I am trying to create a vector of bitsets in C++. For this, I have tried the attempt as shown in the code snippet below:

vector<bitset<8>> bvc;
    while (true) {
        bitset<8> bstemp( (long) xtemp );
        if (bstemp.count == y1) {
            bvc.push_back(bstemp);
        }
        if ( xtemp == 0) {
            break;
        }
        xtemp = (xtemp-1) & ntemp;
    }

When I try to compile the program, I get the error that reads that bvc was not declared in the scope. It further tells that the template argument 1 and 2 are invalid. (the 1st line). Also, in the line containing bvc.push_back(bstemp), I am getting an error that reads invalid use of member function.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top