小编Sic*_*ius的帖子

异常说堆栈是空的,当它不是?

advanced collections在书中学到了一些等等,并且遇到了stacks.我得到了概念,但想制作一个快速程序,从defined point in the stack当时删除一个项目places all the values back onto the stack.我在这里有我的代码,但我得到System.InvalidOperationException类型的异常,其中堆栈的其他信息为空.我似乎无法理解; 有人可以帮忙吗?

这是我的代码:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StackRemover
{
    class Program
    {
        static void Main(string[] args)
        {
            int index = 0; //the index they want to remove
            Stack[] array = new Stack[1]; // will hold the array returned by remove()
            Stack stack = new Stack();

            //fill the stack with values from …
Run Code Online (Sandbox Code Playgroud)

.net c# stack

0
推荐指数
1
解决办法
800
查看次数

标签 统计

.net ×1

c# ×1

stack ×1