这在我的代码中作为错误弹出。请帮忙!

bool validData(int id, float exam1, float exam2, float exam3);
****************************************************
//Purpose: Determine id, exam1, exam2, exam3 are valid or invalid.
//Input: id, exam1, exam2, exam3.
//Precondition: id, exam1, exam2, exam3 are assigned values.
//Output: bool.
//Post condition: This function returns true if all data are valid, otherwise return false.
//Note: None.
****************************************************
{
    if (( id <= MAXID && id >= MINID) && (exam1 <= MAXEXAM && exam1 >= MINEXAM) && (exam2 <= MAXEXAM
    && exam2 >= MINEXAM) && (exam3 <= MAXEXAM && exam3 >= MINEXAM)) {
        return true;
    } else {
        return false;
    }
}

最佳答案

bool validData(int id, float exam1, float exam2, float exam3);


是错误的,不需要分号。

关于c++ - 错误:“{” token 之前的预期非限定ID,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22678222/

10-12 05:23