本文介绍了致命的例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

致命异常0E发生在0028:C027B6DC在VXD VWIN32(04)+00001088。

当前申请将被终止。


相同在DOS下运行的程序不会崩溃。

#include< iostream>

#include< iomanip>


int numb_cities = 0;

const int MAX = 120;


class Cities {

private:

char cityname [MAX] [MAX]; // 120个城市的数组。

int temp [MAX];


public:

Cities();

void output();

};


Cities :: Cities()

{

char y_n;

do {

cout<<" \ n\ n";

cout<<"请输入城市名称:" ;;

cin>> cityname [numb_cities];

cout<< ;" \ n请输入temp:" ;;

cin>> temp [numb_cities];

numb_cities ++;

cout<< ; \ n \\ n另一个城市?(Y / N)&qu ot ;;

cin>> y_n;

} while(y_n ==''y''|| y_n ==''Y'');

cout<<" \ n\ n";

}


void Cities :: output()

{

cout<<" \ n"<<"" city of city"

<<"温度

<<" \ n" ;;

for(int t = 0; t< numb_cities; t ++)

{

cout<< setw(5)<< cityname [t]<< setw(15)<< temp [t]<<" \ n" ;;

}

} //关闭输出


int main()

{

城市信息;

info.output();

返回0;

}


-------------------------------------------- ------

***电子邮件被关闭***

---------------- ----------------------------------

A fatal exception 0E has occurred at 0028:C027B6DC in VXD VWIN32(04)+00001088.
The current application will be terminated.

Same program below run in DOS does not crash.
#include<iostream>
#include<iomanip>

int numb_cities=0;
const int MAX = 120;

class Cities {
private:
char cityname[MAX][MAX];//an array of 120 cities.
int temp[MAX];

public:
Cities();
void output();
};

Cities:: Cities()
{
char y_n;
do{
cout<<"\n\n";
cout<<"Please enter name of city: ";
cin>>cityname[numb_cities];
cout<<"\nPlease enter temp: ";
cin>>temp[numb_cities];
numb_cities++;
cout<<"\nAnother city?(Y/N)";
cin>>y_n;
}while(y_n ==''y'' || y_n ==''Y'');
cout<<"\n\n";
}

void Cities::output()
{
cout<<"\n"<<"name of city"
<<" temperature"
<<"\n";
for(int t=0;t<numb_cities;t++)
{
cout<<setw(5)<<cityname[t]<<setw(15)<<temp[t]<<"\n";
}
}//close output

int main()
{
Cities info;
info.output();
return 0;
}

--------------------------------------------------
*** E-mail is shut off ***
--------------------------------------------------

推荐答案




你对字符串有什么看法?


但是所有这一切,我都不知道我不知道它崩溃的原因....

你试过一个调试器。



What do you have against strings?

But all that being said, I don''t know why it crashes....
Did you try a debugger.





您使用了什么输入?当您输入城市名称时,程序是否立即崩溃或者是否崩溃了,或者当您输入温度时它是否崩溃或者当您输入Y或者是
时N?


我能想到程序可能会崩溃的几个原因,但是你没有给出足够的信息以确定它是哪一个b $ b是。


您是否尝试过使用调试器?您是否尝试将跟踪语句放在

代码中以找出出现了什么问题?你知道哪条线导致

问题吗?


艾伦

-

Defendit numerus



What input did you use? Did the program crash immediately or did it crash when
you entered in the city name or was it when you entered in the temperature or
was it when you entered in Y or N?

I can think of a couple of reasons why the program might crash, but you haven''t
given enough information to determine which one it is.

Have you tried using a debugger? Have you tried putting trace statements in the
code to figure out what is going wrong? Do you know which line is causing the
problem?

Alan
--
Defendit numerus





程序编译但是当我试图运行它时崩溃了;没有机会输入输入。

------------------------- -------------------------

***电子邮件被关闭***

----------------------------------------------- ---



the program compiled but crashed right when I tried to run it; did not have a
chance to enter input.
--------------------------------------------------
*** E-mail is shut off ***
--------------------------------------------------


这篇关于致命的例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 19:57