/// <summary> /// Read from the console untill an invalid number is entered. /// </summary> /// <param name="sampleStack">ICustomList to store the numbers.</param> static void ConsoleReader(ICustomStack<int> sampleStack) { int input = 0; bool toProceed = true; while (toProceed) { toProceed = int.TryParse(Console.ReadLine(), out input); if (toProceed) { sampleStack.Push(input); } } }
public Engine() { this.stack = new CustomStack <string>(); }