Array of Strings in a Class
I've been scouring the internet all morning looking for a solution to this problem, but nothing ever fits what I need. I'm creating a class which needs access to a list of names. I'm having a lot of trouble creating and then accessing this list/array/vector of names. The list is approximately 3005 names long (I copy/paste it in), so I can't use vector.push_back(). I tried using constructors, but couldn't get that to work. Here's a shortened (and simplified) sample of my code:
Code:
class name:
{
std::string first_name[];
public:
name();
static std::string get_first()
{
return first_name[0];
}
};
name::name(void)
{
first_name[] = {"Aaliyah", "Aaron", "Abagail", "Abbey", "Abbie"...}
}
With code identical to that, I get errors:
invalid use of member 'name::first_name' in static member function
expected primary-expression before ']/{' token
Can anyone help me? Is there an easier way to do this?
EDIT: Forgot to mention, I'm new to C++. I've been programming in C for a long time, but this project necessitates C++ for class inheritance.