Hey I have an array of structs and i need to create in program way to change the values of the arrays. I tried using things like findindex but it replaced all values (e.g changed all of Mark's into Jack's even though i only want the one specific "Mark" to change.) What i want to do is make user type the customer number and then change all the values of this array. So if i search and want to edit customernumber[0] i can also change all other values like customersurname[0], customerfornemae[0] and so on. I am posting only the parts of code i think are important but if you guys need any more I' can easily provide.
struct customer
{
public int customernumber;
public string customersurname;
public string customerforname;
public string customerstreet;
public string customertown;
public DateTime customerdob;
}
static void Main(string[] args)
{
customer[] customerdetails = new customer[99];
int selector = 0;
int selector2 = 0;
string vtemp = "";
string ctemp = "";
int searchnumber;
int updatenumber;
string searchforename;
string searchsurname;
string searchtown;
DateTime searchdob;
customer resultnumber;
customer resultforename;
customer resultsurname;
customer resulttown;
customer resultdob;
customer updaterenumber;
if (selector == 3)
{
Console.Clear();
Console.WriteLine("Enter the customer number you wish to update: ");
updatenumber = int.Parse(Console.ReadLine());
updaterenumber = Array.Find(customerdetails, customer => customer.customernumber == updatenumber);
}