vc++问题。。。检查错误

来源:百度知道 编辑:UC知道 时间:2024/06/09 13:12:44
编译通过了,组建也通过了。执行的时候却出问题了,黑屏里什么字都没有。。。。。按go之后再关掉黑屏,调试栏里出现
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
The thread 0xA7C has exited with code -1073741510 (0xC000013A).
The thread 0xFB4 has exited with code -1073741510 (0xC000013A).
The program 'C:\Program Files\Microsoft Visual Studio\MyProjects\asd\Debug\Cpp2.exe' has exited with code -1073741510 (0xC000013A).

源代码:
#include"iostream"
#include"cmath"
using namespace std;
const double pi=3.14;
const double e=2.71828;
double integration(double a, double b, double (*fun)(double x));
double f(double x);
double g(double x);
double h(double x);
void main()
{
double f1,g1,h1;
f1=integration(1,3,f);
g1=integration(0,1,g);
h1=integration(0,pi/2,h);
cout&

问题出现在integration函数中。

while(y<b)
{
integral+=(1e-9)*(fun(y+1e-9)+fun(y)*1e-9)/2;
y=y+1e-9;
}

调用f1=integration(1,3,f);时
y=1;b=3;

当y>=b时才跳出循环,而每次y增加的值是0.000000001,也就是说要循环2000000000次,才跳出循环,这是一个漫长的过程,以至于出现了你说的黑屏什么也没有的情况。其实程序还在执行循环过程。 而且一共调用了3次integration函数。

调试栏里出现的东西不用理会!

建议你在没有系统的纯dos下调试,如弄个虚拟主机什么的.

kjhl