
在命令提示符輸出c語言代碼

If you are someone who loves using the Windows Command Prompt, you may have found yourself curious as to why the screen output buffer has such a ‘large’ default size. Can you change it to a smaller (or even larger) size? Today’s SuperUser Q&A post has the answers.
如果您是喜歡使用Windows命令提示符的人,您可能會發現自己對為什么屏幕輸出緩沖區具有如此大的默認大小感到好奇。 您可以將其更改為較小(甚至更大)的尺寸嗎? 今天的“超級用戶問答”帖子已經給出了答案。
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
今天的“問答”環節由SuperUser提供,它是Stack Exchange的一個分支,該社區是由社區驅動的Q&A網站分組。
問題 (The Question)
SuperUser reader Jay wants to know why the default Windows Command Prompt output buffer size is so large:
SuperUser閱讀器Jay想知道為什么默認的Windows Command Prompt輸出緩沖區大小如此之大:
I have been using the Command Prompt in Windows for a while now and just realized that there are several pages worth of empty lines below the text entry prompt. Why is that?
我已經在Windows中使用命令提示符已有一段時間了,只是意識到在文本輸入提示下有幾頁空白行。 這是為什么?
Why is the default Windows Command Prompt output buffer size so large? Can its size be altered?
為什么默認的Windows命令提示符輸出緩沖區大小如此之大? 可以改變尺寸嗎?
答案 (The Answer)
SuperUser contributors Steven and miltonb have the answer for us. First up, Steven:
超級用戶貢獻者Steven和Miltonb為我們提供了答案。 首先,史蒂文:
The “empty lines” are the rows of screen buffer that have not been filled with output yet. To change the screen buffer size from the default of 300 lines (Microsoft’s chosen default), perform the following steps:
“空行”是屏幕緩沖區中尚未填充輸出的行。 要將屏幕緩沖區大小從默認的300行(Microsoft選擇的默認值)更改,請執行以下步驟:
- Open the Windows Command Prompt 打開Windows命令提示符
- Right-click on the application’s icon in the upper left corner of the window右鍵單擊窗口左上角的應用程序圖標
Click on Properties in the drop down menu
在下拉菜單中單擊屬性
Select the Layout Tab
選擇布局選項卡
Set the Screen Buffer Size (Height Listing) to 20
將屏幕緩沖區大小(列表高度)設置為20
Click OK
點擊確定
Note: I recommend reverting the buffer size to something larger since 20 lines is not much in the way of displayed output.
注意:我建議將緩沖區大小恢復為更大的大小,因為20行顯示的輸出不會太多。
Followed by the answer from miltonb:
隨后是miltonb的回答:
I know that this is not the “why” with regard to your question, but if you want to change the screen buffer size from within a Command Prompt window (or batch file), you can make use of the mode command (mode columns, lines). I regularly use this from within the command prompt:
我知道這不是問題的“原因”,但是如果您想在命令提示符窗口(或批處理文件)中更改屏幕緩沖區的大小,則可以使用mode命令(mode列,行)。 我經常在命令提示符下使用它:
- mode 200, 300 模式200、300
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
有什么補充說明嗎? 在評論中聽起來不錯。 是否想從其他精通Stack Exchange的用戶那里獲得更多答案? 在此處查看完整的討論線程。
翻譯自: https://www.howtogeek.com/235765/can-you-change-the-output-buffer-size-in-the-windows-command-prompt/
在命令提示符輸出c語言代碼