如何在Visual Studio中设置输出控制台宽度 [英] How to set output console width in Visual Studio
问题描述
每当我从Visual Studio 2013构建并运行C ++代码时,控制台窗口的宽度都是不可调整的,因此,导致我的输出比我希望的更快地被推送到下一行.
Whenever I build and run my C++ code from Visual Studio 2013, the console window width is un-adjustable and because of this, causes my output to be pushed onto the next line sooner than I'd like.
如何使Visual Studio增大控制台窗口的宽度?
How can I get Visual Studio to make the console window width larger?
如果我需要在应用程序中插入代码来执行此操作,是否有办法可以进行编译时检查,以便在不使用Windows进行编译时可以删除代码?我正在尝试使代码尽可能地可移植.
If I need to insert code in my application to do this, is there a way I can put a compile-time check so that it removes the code when not compiling on Windows? I'm trying to make the code as portable as possible.
推荐答案
从Visual Studio调试并不需要更改代码的控制台应用程序经常使用的一种解决方案是执行以下操作:
One solution that I use frequently with console applications I debug from Visual Studio that does not require code changes is to do the following:
- 右键单击正在运行的控制台应用程序的标题栏
- 选择属性
- 选择布局
- 然后设置窗口大小.
关闭对话框后,Windows应保存设置或提示您保存,具体取决于您的Windows版本.我相信Windows 8或更高版本不会提示,而Windows 7或更低版本会提示.
After you close the dialog box, Windows should save the settings or prompt you to save depending on your version of Windows. I believe Windows 8 or newer does not prompt, while Windows 7 or lower prompts.
这篇关于如何在Visual Studio中设置输出控制台宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!