static void Main() { names[] client = new names[21]; Record(ref client); Console.ReadLine(); }
static void sort(ref names[] clients) { names[] clients = new names[21]; Record(ref clients); for (int i = 0; i < clients.Length - 1; i++) { for (int pos = 0; pos < clients.Length - 1; pos++) { if (clients[pos + 1].firstName.CompareTo(clients[pos].firstName) < 0) { string temp = clients[pos + 1].firstName; clients[pos + 1].firstName = clients[pos].firstName; clients[pos].firstName = temp; } } } }