对naiveGaussianElimination的调用没有匹配的函数

no matching function for a call to naiveGaussianElimination

本文关键字:函数 naiveGaussianElimination 调用      更新时间:2023-10-16

我正在尝试对此进行调试,但无法解决此处的问题。为什么在我传递了正确的参数之后,它说对naiveGaussianElimination的调用没有匹配函数?

void naiveGaussianElimination(int count,float doubleCoefficient[][count+1]) {

}

int main() {
    /*
     Read from file and assign values to vector
     */
    //File stream object
    ifstream inputFile;
    // store file name
    string fileName;
    // ask user for the file name and store it
    cout << "Enter the file name:>> ";
    cin >> fileName;
    //Open the txt file
    inputFile.open(fileName.c_str());
    //search for the text file
    if(!inputFile.is_open())
    {
        cerr << "Error opening file n";
        exit(EXIT_FAILURE);
    }
    else
    {
        cout << "File found and successfully opened. n";
    }
    /*
     find the number of variables in the equation
     */
    int count =0;
    string line;
    while (getline(inputFile, line)){
        count++;
    }
    cout << "Number of variables: " << count << endl;   // show total variables in text file
    // clear the eof flag and set it to top
    inputFile.clear();
    inputFile.seekg (0, ios::beg);

    // 2D array to store augmented matrix
    float doubleCoefficient [count][count+1];
    naiveGaussianElimination(count,doubleCoefficient);
    inputFile.close();
}

**使用动态数组进行

//2D动态阵列存储扩充矩阵**

float **doubleCoefficient = new float*[count];
    for (int i=0; i<(count+1); i++) {
        doubleCoefficient[i] = new float[count+1];
    }
}