I've got a problem with my code. I've got a class called Player which looks like this
class Player
{
public:
...
Player();
Player(string firstName, string lastName, int birthYear);
~Player();
...
};
My source.cpp looks like this
string firstName = ...;
string lastName = ...;
int birth = ...
Player team[x](firstName, lastName, birth); // <--- This is were I get my errors
My errors are saying
error C3074: an array can only be initialized with an initializer-list
error C2466: cannot allocate an array of constant size 0
error C2057: expected constant expression
The constructor I want to use is Player(string firstName, string lastName, int birthYear). I think that I might be using the default constructor in source.cpp
I want to create 5x Player team[x](firstName, lastName, birth)
But this is where I get my errors. Any suggestions?