簡體   English   中英

每個程序上的“登出”字樣

[英]“logout” word on every program

當我編寫每個C ++程序時,例如:

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    cout << "Tell me where to start: ";
    cin >> n;
    while (n>0) {
        cout << n << "\n";
        n = n-1;
    }
    cout << "FIRE!";
    return 0;
}

我用G ++編譯它,當我運行它時,它運行良好,但是當它完成時,它在程序的最后一個單詞之后顯示“注銷”單詞,如下所示:

Tell me where to start: 10
10
9
8
7
6
5
4
3
2
1
FIRE!logout

[Process completed]

為什么? 我該如何刪除它?

它不是來自您的程序。 這是因為打開終端是出於運行程序的唯一目的,因此退出終端時,終端會關閉。

如果您打開外殼程序並手動運行可執行文件,而不是顯示此消息,您將僅得到另一個命令提示符。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM