#include <stdio.h>
#include <iostream>
#include <conio.h>
#include <locale>
using namespace std;
class Equation
{
private:
double a, b, c, d;
public:
double fun[4];
Equation()
{}
Equation(double a, double b, double c, double d)
{
fun[0] = a;
fun[1] = b;
fun[2] = c;
fun[3] = d;
}
};
int main(int argc, char** argv)
{
for (int i = 0; i<5; i++)
{
Equation arr[i] = new Equation(1, 2, 3, 4);
}
return 0;
}
in this code, I tried to create (for loop) and an array and the type of it Equation and gives it some vales
Equation arr[i] = new Equation(1, 2, 3, 4);
but when I run the code I faced an error(expression must have a constant value).