I'm trying to compare a input by the user with a data filed with in an object. Here is the swtich statment.
Code:
string Icodon = Console.ReadLine();
for(int i=0;i < codons.Length;i++)
{
switch(Icodon)
{
case codons[i].codon1:
Console.WriteLine(codons[i].codon1);
break;
default:
Console.WriteLine("Default");
break;
}
}
here is the object, its defined:
Code:
codon methCodon = new codon("Methionine", "ATG", null, null, null,null, null);
codon[] codons = new codon[1];
codons[0]=methCodon;
I also put it in an object array, can anyone tell me whats wrong?
Here is the error when I compile it:
Code:
C:\Documents and Settings\***\My Documents\Visual Studio Projects\RNA\Class1.cs(56): A constant value is expected