Having problems using an array of strings

Hi,
I am having some problems using an array of strings. See the code below:

String command[2];
command[0] = "egfweg";
command[1] = "egweg";
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

And then, it gives this error:

'command' does not name a type

Yeah, I could initialize the array of strings at the same time when declaring it, like below:

String command[2] = {"egfweg", "egweg"};

But I don't want to do that. I want to initialize the array of strings later.
If I can initialize an array later, then why not an array of strings?
Can anybody help me to fix this problem?

Thanks!

Statements like that are not allowed at file scope. Either move them inside of a function, or initialize the strings directly.

Pieter

command[0] = "egfweg";
command[1] = "egweg";

Those aren't initializations. The are assignment statements. As already stated, they must be inside a function.

Thanks! That helped me.