Arrays in classes not working

So heres my code:
#include <iostream>
#include <string>

using namespace std;

class Planet_Database{

public:

string PlanetNames[10] = { "Earth", "Mars", "Saturn", "Jupiter", "Pluto", "Venus", "Uranus", "Mercury", "Neptune", "Sun" };



private:


};


using namespace std;

int main()
{


Planet_Database PDB;



cout << PDB.PlanetNames[3] << endl;


system("pause");
}

It should display Jupiter, but yea.. i just get this error:

Error 1 error C2536: 'Planet_Database::Planet_Database::PlanetNames' : cannot specify explicit initializer for arrays c:\users\bobby\desktop\game c++\web\web\source.cpp 10 1 Web
Please use code tags.
http://www.cplusplus.com/articles/jEywvCM9/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <string>
using namespace std;

class Planet_Database
{
public:
	static string PlanetNames[10]; 
};
string Planet_Database::PlanetNames[] = { "Earth", "Mars", "Saturn", "Jupiter", "Pluto", 
						"Venus", "Uranus", "Mercury", "Neptune", "Sun" };

int main()
{
	Planet_Database PDB;
	cout << PDB.PlanetNames[3] << endl;
}



Jupiter


http://ideone.com/c3uXVa
Oh ya, code tags, ok, sorry and thanks
Topic archived. No new replies allowed.