I have this class
public class lista
{
Nodo l;
public lista()
{
l = null;
}
public void insertar(int elem)
{
if (l == null)
{
l = new Nodo(elem);
aux = l;
}
else
{
aux = l;
while (aux.prox != null) aux = aux.prox;
Nodo p = new Nodo(elem);
aux.prox = p;
}
}
Nodo aux;
public string mostrar()
{
//Nodo aux = l;
string p = "";
if(aux!=null)
{
p= aux.elem.ToString();
aux = aux.prox;
}
return p;
//
}
}
from the form1 I load the list with the Insert procedure later in the form2 I want you to show them but when initializing the form2 another object is instantiated to be able to access the list and since it is another object this empty what I'm trying to do is access what I already have in the object of form1