I have a class with a constructor that takes three arguments
class Foo{
public: Foo(int, double[], double[]);
};
Foo::Foo(int a, double b[], double c[]){
// function
}
Now what I'm trying is to call this class with arrays that have fixed numbers for example
Foo(4, [4.1, 2.5, 7.2], [5.5, 6.1, 3.8]);
yet this doesn't work. Is such syntax possible in c++ or do I have to change it.
I tried doing it by declaring array variables before like
double x[5];
x[0] = 4.1;
x[1] = 2.5;
x[2] = 7.2;
Foo(4, x, x);
this works but takes way to much time since I want to create multiple of these classes and this would make my code way bigger and unnecessary if there is a better way of doing it.
Thanks in Advance