lundi 6 mars 2017

How to return bitset value in C++?

How to return a bitset function in C++?

bitset<32>* check() {
  bitset<32> v8;
  for (int i = 0; i <= 5; i++) {
    v8[i] = 1;
  }
  return v8;
}

I got this error:

[Error] cannot convert 'std::bitset<32u>' to std::bitset<32u>*' in return

Aucun commentaire:

Enregistrer un commentaire