public struct bank_account
{
public string name;
public string credit_card_number;
}
private List<bank_account> all_accounts = new List<bank_account>();
public bank_account getAccount(string card_number)
{
bank_account holder; // this pointer is the wrong way to do it but im used to c++
foreach(bank_account acc in all_accounts)
{
if (card_number == acc.credit_card_number)
holder = acc;
}
return holder;
}
Im new to c#. Use to c++. Normally in c++ the holder variable would be a pointer. and all i want it to do is point to the correct bank_account structure so i could return it so another function could access the structs variables. How is this done in c#?