C++中bool型变量按位取反总是为true

#include <iostream>
using namespace std;
int main(){
    bool a = false;
    cout << a << endl;
    a = ~a;
    cout << a << endl;
    a = ~a;
    cout << a << endl;
    return 0;
}
0
1
1
原文地址:https://www.cnblogs.com/chmod/p/15489916.html