Answers for "c# iterate and pop all elements in stack"

C#
0

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();
}
Posted by: Guest on February-25-2021

C# Answers by Framework

Browse Popular Code Answers by Language