I'm starting learning C# a couple days, sr if it's stupid question! I had a string array like this
private readonly string[] algorithm_list = {
"Genetic Algorithm",
"Dynamic Algorithm"
};
and my code
switch (al_choose)
{
case algorithm_list[0]:
break;
case algorithm_list[1]:
break;
default:
}
The error is algorithm_list[0] is not a constant! So I try other declaration like
private readonly string[] algorithm_list
or
private contant string[] algorithm_list
But it still doesn't work???? So, any suggestion for me? thanks so much!