public static void Main(string[] args) { char[] chay = new char[5]; chay[0] = 'k'; Mstring name1 = new Mstring(); Mstring name2 = new Mstring(chay); //name1.AppendString(chay); Console.WriteLine(name1.GetString()); name1.SetString("aa"); name2.SetString("aab"); if (name1 > name2) { Console.WriteLine("Name1 is greater!"); } else { Console.WriteLine("Name2 is greater!"); } Person me = new Person(); me.name = "helo"; Console.ReadLine(); //use of goto's for (int j = 0; j < 1000000; j++) { for (int i = 0; i < 100000; i++) { if (i == 2) { goto endofloop; } } } endofloop: Console.WriteLine($"needs code after it {me.name}."); //jump out of both loops when you found i is 10 }
public static void Main(string[] args) { mstack <Mstring> ms2 = new mstack <Mstring>(); Mstring one = new Mstring("louie"); Mstring two = new Mstring("marshy"); ms2.Push(one); ms2.Push(two); mstack2 stack = new mstack2(); stack.Push(10); stack.Push(20); stack.Push(30); Console.WriteLine(stack.Pop()); Console.WriteLine(stack.Pop()); Console.WriteLine(stack.Pop()); for (int i = 0; i < 10000; i++) { stack.Push(i); } Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); int j = 0; while (stack.Pop() != 0) { } Console.ReadKey(); mstack <int> ms = new mstack <int>(); for (int i = 0; i < 10000; i++) { ms.Push(i); } Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); Console.WriteLine("*********************NOW POP IT*********************"); j = 0; while (ms.Pop() != 0) { } }