关于解决Win32控制台程序编译后自动退出
2015-01-18 08:55
513 查看
问题描述:Win32控制台程序编译运行后自动退出,看不到结果,解决此问题有如下几种方法:
使用CTRL+F5进行编译;使用getchar()函数,放在程序的最后;
使用system("pause")函数,放在程序的最后;
#include <iostream>
//#include <stdio.h>
using namespace std;
struct point
{
int x;
int y;
void output()
{
cout<<x<<endl<<y<<endl;
}
};
void main()
{
point pt;
pt.x = 5;
pt.y = 5;
pt.output();
getchar();
//system("pause");
return;
}
还有更多方法,但是以上是最常用的,最简单的方法!
相关文章推荐
- Delphi7编译的程序自动中Win32.Induc.a病毒的解决办法
- 控制台下NMAKE编译WIN32/VC/MFC程序步骤
- 关于如何用od反汇编win32 控制台程序
- VC++/VS2010 Win32控制台程序 运行结束 DOS/dos窗口立刻消失/一闪而过 的解决方法整理
- vc屏蔽回车键解决自动退出程序问题
- MSN2009登陆时程序崩溃自动退出的解决方法。
- win7下用cygwin编译程序出现couldn't allocate heap,win32 error xxx错误的解决办法
- VC MFC 对话框 敲回车,ESE键,程序自动退出解决办法
- 控制台程序执行后不显示"按任意键退出....."的解决方法
- 在控制台程序中解决_beginthread编译不通过问题
- 关于Mq c++程序32位编译 和Mq命令必须加载64位动态库执行 矛盾的解决
- Windows Phone 模拟器(Emulator) 加载程序一闪而过就自动退出的解决办法
- windows2003远程桌面退出后系统自动注销程序关闭的解决方法
- 关于JCreator在编译程序时出现的"Error:Invalid path"问题的解决方法
- 关于vs2010编译程序一闪就没的解决办法
- WIN32控制台程序不能输入中文汉字解决办法
- 关于MFC程序按ENTER和ESC会退出的解决办法
- ios升级为5后,程序编译时遇到的关于libz 1.2.3.dylib类包的各种问题解决办法
- paip.程序不报错自动退出的解决
- 关于VC编译的程序在其他电脑上无法运行的解决办法