c# iterate and pop all elements in stack code example
Example: c# iterate and pop all elements in stack
Stack<Action> stack = new Stack<Action>();
stack.Push(()=>{Console.Write("executed");});
while (stack.Count>0){
stack.Pop().Invoke();
}
Stack<Action> stack = new Stack<Action>();
stack.Push(()=>{Console.Write("executed");});
while (stack.Count>0){
stack.Pop().Invoke();
}