I am beginner in for c#
Please help me for compilation of this code. Also please tell me about these error.
Thanks

using System; 

class SearchEmp 
{ 
    String[] Name= {"Aslam","Irfan","Afridi","Junaid"}; 

    SearchEmp(string name){ 
        this.name = name; 
    } 

    public void Search(){ 
        name= "Afridi"; 
        if(Name[0]==name||Name[1]==name||Name[2]==name||Name[3]==name){ 
            Console.WriteLine("FOUND"); 
        } 
    } 
    private readonly string name; 

    public static void Main(){ 
    SearchEmp E1= new SearchEmp("Kareem"); 
    E1.Search(); 
    } 
}

Also please tell me about these error.

You forgot to list the errors, and your title for this thread is uninformative.

Edited 3 Years Ago by deceptikon

Error

Compiling the source code....
$/usr/local/bin/mcs /tmp/135963473426049/csharp135963473426049.cs 2>&1
/tmp/135963473426049/csharp135963473426049.cs(12,3): error CS0191: A readonly field `SearchEmp.name' cannot be assigned to (except in a constructor or a variable initializer)
Compilation failed: 1 error(s), 0 warnings

A readonly field `SearchEmp.name' cannot be assigned to

So...what does that tell you? It's not like the error is ambiguous or unclear. SearchEmp.name is defined as readonly, yet you try to assign to it as if it were not readonly.

please tell me how i can correct it?
or please correct that code and post here
i am not good with programming

Thankkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
dear deceptikon
now its working

This question has already been answered. Start a new discussion instead.