static strings

I want to make a static class member called dirs that is an array of Strings. My .h file says this

 
static String dirs[8];


and my .cpp file says this

 
String Square::dirs[8] = {"a", "b", "c", "d", "e", "f", "g", "h"};


When I run my code I get some unintelligable error messages


1>y:\windows\dunsonm\documents\visual studio 2008\projects\assignment_2\assignment_2\square.h(35) : error C2146: syntax error : missing ';' before identifier 'dirs'
1>y:\windows\dunsonm\documents\visual studio 2008\projects\assignment_2\assignment_2\square.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>y:\windows\dunsonm\documents\visual studio 2008\projects\assignment_2\assignment_2\square.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>y:\windows\dunsonm\documents\visual studio 2008\projects\assignment_2\assignment_2\square.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


trust me I don't have any missing semi colons. Does anyone know why I'm getting this error message. If someone could let me know and tell me what to change I'd greatly appreciate it.
It looks to me like you didn't include <string>. If you have, try declaring it like static std::string dirs[8];.
yeah I made several errors.

One I didn't include the statement

 
using namespace std;


and the other error is I spelled string with a capital S.

Thanks Thumper
Topic archived. No new replies allowed.