小编Dan*_*nia的帖子

数组下标的无效类型“float*[float]”

我想显示 x 和 f(x) 的范围并将 f(x) 保留在数组中,但我总是收到此错误:

invalid type 'float*[float]' for array subscript
Run Code Online (Sandbox Code Playgroud)

有人能帮我吗?我还是卡住了。

这是代码:

#include <iostream>
#include <cmath>
#include <math.h>
using std::cin;
using std::cout;

using namespace std;
void displayValue(float funx[], float j, float x);

int main()
{
    float num9[]={};
    float a, r;
    displayValue(num9, a, r);

    return 0;
}
void displayValue(float funx[], float j, float x)
{
    float i;
    cout << "Please enter range of x: " << endl;
    for (i=0; i<1; i++)
    {
        cin >> x >> j;
    } …
Run Code Online (Sandbox Code Playgroud)

c++ c++11

2
推荐指数
1
解决办法
65
查看次数

标签 统计

c++ ×1

c++11 ×1