我想显示 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)