Recursive Boolean expression

-sharpinclude <iostream>
-sharpinclude <cstring>
-sharpinclude <cstdlib>
-sharpinclude <cmath>
using namespace std;
bool factor();
bool term();
bool term() {
    char c = cin.peek();
    bool result = 0;
    if (c == "!") {
        result = term();
        result=!result;
        cin.get();
    }
    result = factor();
    bool more = 1;
    while (more) {
        c = cin.peek();
        if (c == "&" || c == "|") {
            cin.get();
            bool value;
            value = factor();
            if (c == "&") result = result & value;
            else result |= value;
        }
        else more = 0;
    }
    return result;
}
bool factor() {
    char c = cin.peek();
    bool result=0;
    if (c == "(") {
        cin.get();
        result=term();
        cin.get();
    }
    else if (c == "V" || c == "F") {
        if (c == "V") result = 1;
        else result = 0;
        cin.get();
    }
    return result;


}
int main() {
    cout << term() << endl;
    while (1);
    return 0;
}

Why can"t I recognize the exclamation point? For beginners, I don"t quite understand, ask for advice, and I don"t know if the program is right. At present, the first problem encountered is the exclamation point,

CPP c
Jul.26,2021

add a cin.get () after line 11 to eat "!". Peek asks for symbols but does not delete them from the queue.

  if (c == '!') {
        cin.get();//eat up "!" symbol 
        result = term();
...

of course, there are other logic problems with the code. Look for it.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a952-2c219.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a952-2c219.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?