运行DEV—c++时的问题

来源:百度知道 编辑:UC知道 时间:2024/06/17 03:49:41
运行时命令提示符闪一下就没了,看不到结果,不知是何原因
比如运行简单程序是这样加吗?
#include<iostream>
int main()
{
std::cout<<"hello world.\n";
}
system("pause");

加到main函数里面啊,加到外面是没用的
这样
#include<iostream>
int main()
{
std::cout<<"hello world.\n";
system("pause");
}

#include<iostream>
int main()
{
std::cout<<"hello world.\n";
getchar(); // 按任意键结束
}

你在最后加一句system("pause")就可以了