Hi, I have an object that takes an array as a parameter of the constructor:
Code:
class Foo {
public:
Foo(int array[]);
private:
int _array[];
}
If I want an array of the above type, and I want to pass in the array in one go:
Code:
Foo otherArray[5];
otherArray[0] = Foo({1,2,3,4,5});
How can I do that? It isnt happy?
I tried changing the array in the class Foo to an int* and then also passing the size, i.e:
Code:
Foo otherArray[5];
otherArray[0] = Foo({1,2,3,4,5}, 5;
but that didnt work either? It doesnt compile...
Thanks