| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 964 人关注过本帖
标题:编译不提示出错,运行出现abnormal program termintion .
只看楼主 加入收藏
lisypro
Rank: 4
等 级:业余侠客
威 望:3
帖 子:695
专家分:216
注 册:2005-9-25
结帖率:33.33%
收藏
 问题点数:0 回复次数:4 
编译不提示出错,运行出现abnormal program termintion .

编译不提示出错,运行出现abnormal program termintion .
原程序如下
// cf.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "cf.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
CString strTemp;
CFile mFile;
cout <<"1sd";
if(mFile.Open("d:\\1.txt",CFile::modeRead)==0)
{
cout <<"sd";
return 0;
}

CArchive ar(&mFile,CArchive::load);
ar >> strTemp;//本语句处 出错,但编译不出错。
cout << "22";//本语句未能正常输出


ar.Close();
mFile.Close();
cout << strTemp;
}

return nRetCode;
}

搜索更多相关主题的帖子: program abnormal termintion 编译 运行 
2006-03-06 09:40
lisypro
Rank: 4
等 级:业余侠客
威 望:3
帖 子:695
专家分:216
注 册:2005-9-25
收藏
得分:0 
没人会么

长期承接管理系统
代做各种vb/ / vc小程序
QQ:82341763
手机:13623290828
群号 11619730
2006-03-07 14:34
high20033763
Rank: 1
等 级:新手上路
帖 子:85
专家分:0
注 册:2006-2-13
收藏
得分:0 
我是个新手,可能是你用了assert函数,英文意思你也大概知道了吧,非正常出错,可能是内存分配出错,或者文件打一不开等
2006-03-09 23:27
high20033763
Rank: 1
等 级:新手上路
帖 子:85
专家分:0
注 册:2006-2-13
收藏
得分:0 
不好意思,贴了没看清楚,现在就可能是路径出错了,可能,没试过
2006-03-09 23:29
lisypro
Rank: 4
等 级:业余侠客
威 望:3
帖 子:695
专家分:216
注 册:2005-9-25
收藏
得分:0 

楼上的如果感兴趣可以自己调 一下


长期承接管理系统
代做各种vb/ / vc小程序
QQ:82341763
手机:13623290828
群号 11619730
2006-03-14 15:03
快速回复:编译不提示出错,运行出现abnormal program termintion .
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019304 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved