Visual Studio调试控制台无法打印所有内容

时间:2019-11-11 16:17:26

标签: c# debugging console

我正在使用c#进行课程学习,尽管我的代码是相同的,但它不能完全打印程序。例如,如果我有5次Console.WriteLine(“ Hello”),则仅打印4次。

现在,我正在尝试对一些整数求立方,而不是正确打印,它在调试停止时向我显示“ le”。 按任意键关闭此窗口。 。 。”“ le”一词被截断,在此之前的所有内容均不显示。

另外,当我运行控制台时,窗口会尽可能小地打开,我必须手动更改尺寸以查看其打印内容。

我故意添加了一些额外的WriteLines,但是仅显示最后2条

{
    class Program
    {
        static void Main(string[] args)
        {
            string characterName = "Tom";
            int characterAge;
            characterAge = 25;


                Console.WriteLine("There was once a man named " + characterName);
                Console.WriteLine("He was " + characterAge + " years old.");
                characterName = "Mike";
                Console.WriteLine("He really liked the name " + characterName);
                Console.WriteLine("But didn't like being " + characterAge);
                Console.WriteLine("But didn't like being " + characterAge);
                Console.WriteLine("But didn't like being " + characterAge);
                Console.WriteLine("But didn't like being " + characterAge);
                Console.WriteLine("But didn't like being " + characterAge);

            Console.ReadLine();
        }
    }
}

0 个答案:

没有答案