I execute the following method:
static bool elimino(int[] lista, string[] nombre, string nom, ref int tope)
{
Console.Write("Nombre");
nom = Console.ReadLine()
bool e = false;
for (int i = 0; i < tope; i++)
{
if (nom == nombre[i])
{
for (int j = i; j < tope - 1; j++)
{
lista[j] = lista[tope - 1];
nombre[j] = nombre[j - 1];
tope--;
e = true;
i = tope;
}
}
}
return e;
}
I invoke it in this way (I think it's the right one)
static void Main(string[] args) {
string[] nombre; string nom; int opcion,
tope = 0, cantidad; bool seguir = true;
elimino(vector, nombre, nom, ref tope);
}
But anyway he tells me
"use of the unmapped local variable nom,
I declare it as string
, and even then I mark the error in nom, I can not execute the method to test if it works