我想從我的bitset代表的數字中減去一個整數。但是,我不知道如何可以一)一個bitset複製到另一個位集合,或b)重實例化一個bitset:std :: bitset redeclaration
bitset<7> bits(5);
int newresult=bits.to_ulong();
newresult=newresult-1;
bits=bitset<7> tempbits(newresult); // of course doesn't work
重要的是,我的最終結果是位位集。如何正確地做到這一點?
'位=位集<7>(newresult);' – ildjarn
這看起來像一個答案,@ildjarn。 –
@Robᵩ:我們稱這些免費贈品。 – Wug