简体   繁体   English

Netbeans C++ 奇怪的 output

[英]Netbeans C++ Weird output

#include <iostream>
using namespace std;

int main(){
    cout<<"Hello World!"<<endl;
}

I recently installed netbeans 12.0 and when I compile the code above, it says some weird words and numbers and a letter 'H'.我最近安装了 netbeans 12.0,当我编译上面的代码时,它显示了一些奇怪的单词和数字以及一个字母“H”。

Also the words using , namespace , cout , and endl are underlined and when I hover to it, it says:单词usingnamespacecoutendl也有下划线,当我 hover 到它时,它说:

unable to resolve identifier + 'word'无法解析标识符+“单词”

This is the output:这是 output:

PSID=1493                                                                       
NBMAGIC=1492                                                                                                                                                   
H                                                                               
RUN SUCCESSFUL (total time: 101ms)                 

As @user4581301 specified that the programs runs and immediately quits so you are not able to see anything.正如@user4581301 指定的程序运行并立即退出,所以你什么都看不到。 So, we need something to pause the program.所以,我们需要一些东西来暂停程序。

#include <iostream>
using namespace std;

int main(){
    cout<<"Hello World!"<<endl;
    system("pause");
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM