程序“[1344] MyProject2.exe: 本机”已退出,返回值为 0 (0x0) 错误解决方法

笔记本用的是win7 64位的系统,没法再用以前的VC6.0了,所以就用了VS2010,在编写窗口程序的时候,运行的时候总是一闪而过,并输出以下的信息,还真是麻烦呀!

“MyProject2.exe”: 已加载“D:\vc练习\MyProject2\Debug\MyProject2.exe”,已加载符号。
“MyProject2.exe”: 已加载“C:\Windows\SysWOW64\ntdll.dll”,Cannot find or open the PDB file
“MyProject2.exe”: 已加载“C:\Windows\SysWOW64\kernel32.dll”,Cannot find or open the PDB file
“MyProject2.exe”: 已加载“C:\Windows\SysWOW64\KernelBase.dll”,Cannot find or open the PDB file
“MyProject2.exe”: 已加载“C:\Windows\SysWOW64\msvcp100d.dll”,已加载符号。
“MyProject2.exe”: 已加载“C:\Windows\SysWOW64\msvcr100d.dll”,已加载符号。
程序“[1344] MyProject2.exe: 本机”已退出,返回值为 0 (0x0)。


我的代码如下:

#include <iostream>
using std::cout;
using std::endl;

#include "stdlib.h "

#include <iomanip>
using std::setw;

#include <cstdlib>
using std::rand;

int main()
{
for(int counter=1;counter<=20;counter++)
{
//从1到6数字中随机选取,并输出
cout<<setw(10)<<(1+rand()%6);

if(counter%5==0)
cout<<endl;
}
return 0;
}

后来上网查了一下解决方法,只要在 return 0前面加上 system("pause"); 这行代码以后就没有问题了。

原文地址:https://www.cnblogs.com/hxxy2003/p/2233324.html