【发布时间】:2014-09-18 03:12:09
【问题描述】:
- 好的,我正在制作一个 Stack whit 数组。但我需要像锯齿状数组一样在堆栈中推送数组。
- 问题:没有有效的参数。
方法推送:
public bool Push(T [] dato, int tamanio2)
{
if(tope==max)
{
Console.WriteLine("Imposible ingresar datos, la pila esta llena");
return false;
}
else
{
Arreglo[tope] = dato[tamanio2];
tope++;
return true;
}
}
主要:
Cpila < string [] > pila = new Cpila< string[] >(10);
string [] Nombres = new string [5] {"Carlos","Jose", "Patricio","Pedro","Andres"};
pila.Push(Nombres,5);
【问题讨论】:
-
问题是什么?
-
我需要将 main 中的初始化数组传递给 Push 方法,但它给了我一个错误
标签: c# arrays static stack jagged-arrays