I'm a new student to C# and I have a project I'm kind of stuck on. I need to create a method that uses an index\ID number to find and remove information on an employee.
This uses a structure, "Employee" and a list, "employees" and I'm just lost as to how I'm supposed to remove the all the information from the list. Do I set all the field values, including strings, to 0?
The following are the instructions I was given for this method -- "c) DeleteEmployee( ) Takes the index of the employee as a parameter. Remove the employee with the parameter value"
private int DeleteEmployee (int index)
{
foreach (Employee E in employees)
{
if (index == E.id) {}
// i'm just stuck on what to do from this point
}
// return zero is just here temporarily
return 0;
}